Hello community,
here is the log from the commit of package yast2-qt
checked in at Sat May 17 21:30:23 CEST 2008.
--------
--- yast2-qt/yast2-qt.changes 2008-05-16 14:00:43.000000000 +0200
+++ yast2-qt/yast2-qt.changes 2008-05-17 18:21:35.000000000 +0200
@@ -1,0 +2,10 @@
+Sat May 17 18:19:22 CEST 2008 - coolo@suse.de
+
+- fix font handling during installation (bnc#357258)
+
+-----------------------------------------------------------------------
+Fri May 16 17:10:03 CEST 2008 - tgoettlicher@suse.de
+
+- Adjust QY2ListView to enable scrolling in wizard (bnc #391048)
+
+-------------------------------------------------------------------
Old:
----
yast2-qt-2.16.48.tar.bz2
New:
----
yast2-qt-2.16.49.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-qt.spec ++++++
--- /var/tmp/diff_new_pack.f28897/_old 2008-05-17 21:27:42.000000000 +0200
+++ /var/tmp/diff_new_pack.f28897/_new 2008-05-17 21:27:42.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-qt (Version 2.16.48)
+# spec file for package yast2-qt (Version 2.16.49)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
Name: yast2-qt
-Version: 2.16.48
+Version: 2.16.49
Release: 1
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-qt-2.16.48.tar.bz2
+Source0: yast2-qt-2.16.49.tar.bz2
BuildRequires: docbook-xsl-stylesheets
BuildRequires: doxygen
BuildRequires: libdrm-devel
@@ -112,6 +112,10 @@
%_includedir/*
%changelog
+* Sat May 17 2008 coolo@suse.de
+- fix font handling during installation (bnc#357258)
+* Fri May 16 2008 tgoettlicher@suse.de
+- Adjust QY2ListView to enable scrolling in wizard (bnc #391048)
* Fri May 16 2008 tgoettlicher@suse.de
- Fixed YUINoDialogException caused by popup windows
- V 2.16.48
++++++ yast2-qt-2.16.48.tar.bz2 -> yast2-qt-2.16.49.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/package/yast2-qt.changes new/yast2-qt-2.16.49/package/yast2-qt.changes
--- old/yast2-qt-2.16.48/package/yast2-qt.changes 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/package/yast2-qt.changes 2008-05-17 18:21:39.000000000 +0200
@@ -1,4 +1,14 @@
-------------------------------------------------------------------
+Sat May 17 18:19:22 CEST 2008 - coolo@suse.de
+
+- fix font handling during installation (bnc#357258)
+
+-----------------------------------------------------------------------
+Fri May 16 17:10:03 CEST 2008 - tgoettlicher@suse.de
+
+- Adjust QY2ListView to enable scrolling in wizard (bnc #391048)
+
+-------------------------------------------------------------------
Fri May 16 13:58:11 CEST 2008 - tgoettlicher@suse.de
- Fixed YUINoDialogException caused by popup windows
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/CMakeLists.txt new/yast2-qt-2.16.49/src/CMakeLists.txt
--- old/yast2-qt-2.16.48/src/CMakeLists.txt 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/CMakeLists.txt 2008-05-17 18:21:39.000000000 +0200
@@ -17,7 +17,6 @@
QY2DiskUsageList.cc
QY2HelpDialog.cc
QY2ListView.cc
- QY2Settings.cc
QY2Styler.cc
YFrameBuffer.cc
YQAlignment.cc
@@ -78,7 +77,6 @@
QY2DiskUsageList.h
QY2HelpDialog.h
QY2ListView.h
- QY2Settings.h
QY2Styler.h
utf8.h
YFrameBuffer.h
@@ -149,6 +147,7 @@
TARGET_LINK_LIBRARIES( py2qt ${QT_QTCORE_LIBRARY} )
TARGET_LINK_LIBRARIES( py2qt ${QT_QTGUI_LIBRARY} )
TARGET_LINK_LIBRARIES( py2qt dl X11 )
+TARGET_LINK_LIBRARIES( py2qt fontconfig )
SET_TARGET_PROPERTIES( py2qt PROPERTIES SOVERSION 2 )
SET_TARGET_PROPERTIES( py2qt PROPERTIES LINK_FLAGS "-Wl,--no-undefined" )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/lang_fonts new/yast2-qt-2.16.49/src/lang_fonts
--- old/yast2-qt-2.16.48/src/lang_fonts 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/lang_fonts 2008-05-17 18:21:39.000000000 +0200
@@ -1,36 +1,36 @@
# Language specific fonts for yast2-qt
#
# Used upon UI::SetLanguage( lang )
-# Fallback strategy for a locale "xy_AB.UTF8":
+# Fallback strategy for a locale xy_AB.UTF8:
#
# font[xy_AB.UTF8] = ???
# font[xy_AB] = ???
# font[xy] = ???
# font = ???
#
-# If none of those is found, "Sans Serif" is used.
+# If none of those is found, Sans Serif is used.
#
# Don't enumerate all languages just for the fun of it,
# better specify a reasonable default with
#
# font = ???
-font = "Sans Serif"
-font[zh] ="Albany AMT,DejaVu Sans,SUSE Sans,FZSongTi,FZMingTiB,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
-font[zh_CN] = "Albany AMT,DejaVu Sans,SUSE Sans,FZSongTi,FZMingTiB,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
-font[zh_SG] = "Albany AMT,DejaVu Sans,SUSE Sans,FZSongTi,FZMingTiB,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
-font[zh_TW] = "Albany AMT,DejaVu Sans,SUSE Sans,FZMingTiB,FZSongTi,AR PL Mingti2L Big5,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
-font[zh_HK] = "Albany AMT,DejaVu Sans,SUSE Sans,FZMingTiB,FZSongTi,AR PL Mingti2L Big5,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
-font[ja] = "Albany AMT,DejaVu Sans,SUSE Sans,HGPGothicB,IPAPGothic,IPAGothic,Sazanami Gothic,Efont Biwidth,Gnu Unifont,Sans Serif"
+font="Sans Serif"
+font[zh]="Albany AMT,DejaVu Sans,SUSE Sans,FZSongTi,FZMingTiB,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
+font[zh_CN]="Albany AMT,DejaVu Sans,SUSE Sans,FZSongTi,FZMingTiB,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
+font[zh_SG]="Albany AMT,DejaVu Sans,SUSE Sans,FZSongTi,FZMingTiB,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
+font[zh_TW]="Albany AMT,DejaVu Sans,SUSE Sans,FZMingTiB,FZSongTi,AR PL Mingti2L Big5,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
+font[zh_HK]="Albany AMT,DejaVu Sans,SUSE Sans,FZMingTiB,FZSongTi,AR PL Mingti2L Big5,AR PL SungtiL GB,Gnu Unifont,Efont Biwidth,Sans Serif"
+font[ja]="Albany AMT,DejaVu Sans,SUSE Sans,HGPGothicB,IPAPGothic,IPAGothic,Sazanami Gothic,Efont Biwidth,Gnu Unifont,Sans Serif"
# For debugging
-font[xy_AB.UTF8] = "xy_AB_UTF8, Sans Serif"
-font[xy_XY] = "xy_XY, Sans Serif"
-font[xy] = "xy, Sans Serif"
-
-font[times] = "Times"
-font[sans] = "Sans Serif"
-font[helv] = "Helvetica"
+font[xy_AB.UTF8]="xy_AB_UTF8, Sans Serif"
+font[xy_XY]="xy_XY, Sans Serif"
+font[xy]="xy, Sans Serif"
+
+font[times]="Times"
+font[sans]="Sans Serif"
+font[helv]="Helvetica"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/QY2ListView.cc new/yast2-qt-2.16.49/src/QY2ListView.cc
--- old/yast2-qt-2.16.48/src/QY2ListView.cc 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/QY2ListView.cc 2008-05-17 18:21:39.000000000 +0200
@@ -51,6 +51,13 @@
connect( this, SIGNAL( columnResized ( int, int, int ) ),
this, SLOT ( columnWidthChanged( int, int, int ) ) );
#endif
+
+ connect( this, SIGNAL( itemExpanded ( QTreeWidgetItem *) ),
+ this, SLOT ( treeExpanded ( QTreeWidgetItem *) ) );
+
+ connect( this, SIGNAL( itemCollapsed ( QTreeWidgetItem *) ),
+ this, SLOT ( treeCollapsed ( QTreeWidgetItem *) ) );
+
}
@@ -506,4 +513,20 @@
#endif
+void QY2ListView::treeExpanded( QTreeWidgetItem * listViewItem )
+{
+ if ( columnCount() == 1 && header() && header()->isHidden() )
+ resizeColumnToContents( 0 );
+}
+
+
+void QY2ListView::treeCollapsed( QTreeWidgetItem * listViewItem )
+{
+ if ( columnCount() == 1 && header() && header()->isHidden())
+ resizeColumnToContents( 0 );
+}
+
+
+
+
#include "QY2ListView.moc"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/QY2ListView.h new/yast2-qt-2.16.49/src/QY2ListView.h
--- old/yast2-qt-2.16.48/src/QY2ListView.h 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/QY2ListView.h 2008-05-17 18:21:39.000000000 +0200
@@ -114,6 +114,7 @@
int col,
const QPoint & pos );
+
public:
/**
@@ -169,6 +170,17 @@
**/
void columnWidthChanged( int col, int oldSize, int newSize );
+ /**
+ * Internal notification that a tree item has been expanded
+ */
+ void treeExpanded( QTreeWidgetItem * listViewItem );
+
+ /**
+ * Internal notification that a tree item has been collapsed
+ */
+ void treeCollapsed( QTreeWidgetItem * listViewItem );
+
+
protected:
/**
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/QY2Settings.cc new/yast2-qt-2.16.49/src/QY2Settings.cc
--- old/yast2-qt-2.16.48/src/QY2Settings.cc 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/QY2Settings.cc 1970-01-01 01:00:00.000000000 +0100
@@ -1,312 +0,0 @@
-/*---------------------------------------------------------------------\
-| |
-| __ __ ____ _____ ____ |
-| \ \ / /_ _/ ___|_ _|___ \ |
-| \ V / _` \___ \ | | __) | |
-| | | (_| |___) || | / __/ |
-| |_|\__,_|____/ |_| |_____| |
-| |
-| contributed Qt classes |
-| (C) SuSE Linux AG |
-\----------------------------------------------------------------------/
-
- File: QY2Settings.cpp
-
- Author: Stefan Hundhammer
-
- This is a pure Qt class - it can be used independently of YaST2.
-
-/-*/
-
-
-
-#include "QY2Settings.h"
-
-#include <QFile>
-#include <QRegExp>
-
-#include <iostream>
-
-using std::cout;
-using std::cerr;
-using std::endl;
-
-
-QY2Settings::QY2Settings( const QString & fileName, AccessMode accessMode )
- : _fileName( fileName )
- , _accessMode( accessMode )
-{
- if ( _accessMode == ReadOnly || _accessMode == ReadWrite )
- load();
- else
- initSections();
-}
-
-void QY2Settings::initSections()
-{
- _defaultSection = new Section( "" );
- Q_CHECK_PTR( _defaultSection );
-
- _currentSection = _defaultSection;
- _sections.insert( "", _defaultSection );
-}
-
-
-
-QY2Settings::~QY2Settings()
-{
- if ( _dirty && _accessMode != ReadOnly )
- save();
-}
-
-
-bool QY2Settings::selectSection( const QString & sectionName )
-{
- _currentSection = _sections[ sectionName ];
-
- if ( _currentSection )
- {
- return true;
- }
- else
- {
- _currentSection = _defaultSection;
- return false;
- }
-}
-
-
-void QY2Settings::selectDefaultSection()
-{
- _currentSection = _defaultSection;
-}
-
-
-QStringList QY2Settings::sections( bool includeUnnamed ) const
-{
- QStringList sectionList;
- SectionIterator it( _sections );
-
- while ( it.hasNext() )
- {
- QString sectionName = (it.value())->name();
-
- if ( includeUnnamed || ! sectionName.isEmpty() )
- sectionList.append( sectionName );
-
- it.next();
- }
-
- return sectionList;
-}
-
-
-QString QY2Settings::get( const QString & key, const QString & fallback ) const
-{
- // Can't use operator[] here since we have a pointer
-
- Section::const_iterator it = _currentSection->find( key );
-
- if ( it == _currentSection->constEnd() )
- return fallback;
-
- return it.value();
-}
-
-
-QString QY2Settings::operator[] ( const QString & key )
-{
- return get( key );
-}
-
-
-bool QY2Settings::hasKey( const QString & key )
-{
- return _currentSection->contains( key );
-}
-
-
-QStringList QY2Settings::keys() const
-{
- QStringList keyList;
-
- for ( Section::const_iterator it = _currentSection->constBegin();
- it != _currentSection->constEnd();
- ++it )
- {
- keyList.append( it.key() );
- }
-
- return keyList;
-}
-
-
-bool QY2Settings::load()
-{
- initSections();
- _readError = false;
-
- if ( _accessMode == WriteOnly )
- return false;
-
-
- QFile file( _fileName );
-
- if ( ! file.open( QIODevice::ReadOnly ) )
- {
- cerr << "Can't load settings from " << qPrintable( _fileName )
- << ": " << qPrintable( file.errorString() )
- << endl;
-
- _readError = true;
-
- return false;
- }
-
- QTextStream str( &file );
- str.setAutoDetectUnicode(true);
- QString line;
- int lineCount = 0;
-
- while ( ! file.atEnd() )
- {
- line = str.readLine().trimmed();
- lineCount++;
-
-
- // Skip empty lines
-
- if ( line.isEmpty() ) continue;
-
-
- // Skip comment lines
-
- if ( line.startsWith( "#" ) ) continue;
- if ( line.startsWith( ";" ) ) continue;
- if ( line.startsWith( "//" ) ) continue;
-
-
- if ( line.startsWith( "[" ) )
- {
- // New section
-
- line.replace( QRegExp( "^\\[\\s*" ), "" );
- line.replace( QRegExp( "\\s*\\].*$" ), "" );
- addSection( line );
- }
- else if ( line.contains( "=" ) )
- {
- // key=value pair
-
- QString key = line.section( "=", 0, 0 ).trimmed();
- QString value = line.section( "=", 1, 1 ).trimmed();
-
- value.replace( QRegExp( "^\"" ), "" ); // strip leading "
- value.replace( QRegExp( "\"$" ), "" ); // strip trailing "
- value.replace( "\\\"", "\"" ); // un-escape "
-
- set( key, value );
- }
- else
- {
- qWarning( "%s:%d: Syntax error: %s",
- qPrintable( _fileName ), lineCount, qPrintable( line ) );
- }
- }
-
- _dirty = false;
-
- return true;
-}
-
-
-bool QY2Settings::save()
-{
- if ( _accessMode == ReadOnly )
- return false;
-
- QFile file( _fileName );
-
- if ( ! file.open( QIODevice::WriteOnly ) )
- {
- cerr << "Can't save settings to " << qPrintable( _fileName )
- << ": " << qPrintable( file.errorString() )
- << endl;
-
- return false;
- }
-
- QTextStream str( &file );
- str.setAutoDetectUnicode(true);
-
- // The default section must be saved first since it doesn't have a section
- // name that could be used for a headline
- saveSection( str, _defaultSection );
-
- SectionIterator sectIt( _sections );
-
- while ( sectIt.hasNext() )
- {
- if ( sectIt.value() != _defaultSection )
- saveSection( str, sectIt.value() );
- sectIt.next();
- }
-
- _dirty = false;
-
- return true;
-}
-
-
-void QY2Settings::saveSection( QTextStream & str, Section * sect )
-{
- // Section header
-
- if ( ! sect->name().isEmpty() )
- str << "[" << sect->name() << "]" << endl;
-
- // value=key pairs for this section
-
- for ( Section::iterator it = sect->begin();
- it != sect->end();
- ++it )
- {
- QString value = it.value();
- value.replace( "\"", "\\\"" ); // Escape embedded " with \"
-
- str << it.key() << "= \"" << value << "\"" << endl;
- }
-
- str << endl;
-}
-
-
-void QY2Settings::set( const QString & key, const QString & value )
-{
- _currentSection->insert( key, value );
- _dirty = true;
-}
-
-
-void QY2Settings::addSection( const QString & sectionName )
-{
- _currentSection = _sections[ sectionName ]; // already there?
-
- if ( _currentSection ) // -> use it
- return;
-
- _currentSection = new Section( sectionName );
- Q_CHECK_PTR( _currentSection );
-
- _sections.insert( sectionName, _currentSection );
- _dirty = true;
-}
-
-
-void QY2Settings::clearSection()
-{
- _currentSection->clear();
- _dirty = true;
-}
-
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/QY2Settings.h new/yast2-qt-2.16.49/src/QY2Settings.h
--- old/yast2-qt-2.16.48/src/QY2Settings.h 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/QY2Settings.h 1970-01-01 01:00:00.000000000 +0100
@@ -1,255 +0,0 @@
-/*---------------------------------------------------------------------\
-| |
-| __ __ ____ _____ ____ |
-| \ \ / /_ _/ ___|_ _|___ \ |
-| \ V / _` \___ \ | | __) | |
-| | | (_| |___) || | / __/ |
-| |_|\__,_|____/ |_| |_____| |
-| |
-| contributed Qt classes |
-| (C) SuSE Linux AG |
-\----------------------------------------------------------------------/
-
- File: QY2Settings.h
-
- Author: Stefan Hundhammer
-
- This is a pure Qt class - it can be used independently of YaST2.
-
-/-*/
-
-
-#ifndef QY2Settings_h
-#define QY2Settings_h
-
-#include <QString>
-#include <QMap>
-#include <QHash>
-#include <QStringList>
-#include <QTextStream>
-
-/**
- * Utility class that handles program settings in .ini file format:
- *
- * key="value"
- * key2 = value
- * ; comment
- * # comment
- *
- * [section-title]
- * key = "value"
- * ; comment
- * key2="value"
- * key3 = _( "message that needs to be translated" )
- *
- * [section-title2]
- * key="value"
- * key2="value"
- *
- * key=value pairs appear one on a line each. Leading and trailing whitespace
- * is disregarded around both key and value. Value should be quoted (but
- * doesn't need to). Quotes in value are escaped with \".
- **/
-class QY2Settings
-{
-public:
-
- enum AccessMode
- {
- ReadOnly,
- ReadWrite,
- WriteOnly
- };
-
- /**
- * Constructor. Reads settings from the specified file.
- *
- * Use readError() or readOk() afterwards to check for read errors.
- **/
- QY2Settings( const QString & fileName, AccessMode accessMode=ReadOnly );
-
- /**
- * Destructor.
- *
- * Writes any pending changes back to the file if there are any left
- * if accessMode() is ReadWrite or WriteOnly.
- **/
- ~QY2Settings();
-
- /**
- * Returns 'true' if the settings couldn't be read from the file specified
- * in the constructor.
- **/
- bool readError() const { return _readError; }
-
- /**
- * Returns 'true' if the settings were read without problems from the file
- * specified in the constructor. This is simply the opposite of
- * readError().
- **/
- bool readOk() const { return ! _readError; }
-
- /**
- * Select the specified section in the settings for subsequent get()
- * calls. Until is used, the unnamed default section is used.
- *
- * In the settings file, a section is marked with
- *
- * [section-title]
- *
- * Using a null string (QString::null) switches back to the unnamed default
- * section.
- *
- * Returns 'true' upon success, 'false' if there is no such section (in
- * which case the unnamed default section will be selected).
- **/
- bool selectSection( const QString & section );
-
- /**
- * Select the default (unnamed) section for subsequent get() calls.
- * This is the default unless selectSection() was called.
- **/
- void selectDefaultSection();
-
- /**
- * Returns the name of the current section or QString::null if the default
- * section is used.
- **/
- QString currentSection() const { return _currentSectionName; }
-
- /**
- * Returns a list of all sections.
- * 'includeUnnamed' specifies if the unnamed default section should be
- * included in the list.
- * The list sort order is undefined.
- **/
- QStringList sections( bool includeUnnamed = false ) const;
-
- /**
- * Returns the value for the specified key in the current section.
- * If there is no such key, the specified fallback value is returned.
- **/
- QString get( const QString & key,
- const QString & fallback = "") const;
-
- /**
- * Same as get() with fallback always an empty string
- **/
- QString operator[] ( const QString & key );
-
- /**
- * Checks if the current section has the specified key.
- **/
- bool hasKey( const QString & key );
-
- /**
- * Returns a list of all keys in the current section.
- * The list sort order is undefined.
- **/
- QStringList keys() const;
-
- //
- // Write access
- //
- // All write access functions will fail if the current access mode is not
- // one of ReadWrite / WriteOnly.
- //
-
- /**
- * Set the specified key to the specified value. Overwrites any existing
- * key-value pair or adds a new one if there is no such key yet.
- **/
- void set( const QString & key, const QString & value );
-
- /**
- * Add a section with the specified name. If a section with that name
- * already exists, it will only be selected and its old contents will
- * remain untouched.
- * In any case, this section becomes the current section.
- **/
- void addSection( const QString & section );
-
- /**
- * Clear all key=value pairs from the current section.
- **/
- void clearSection();
-
- /**
- * Writes changed settings back to the file specified in the constructor if
- * accessMode() is ReadWrite or WriteOnly.
- *
- * Returns 'true' on success.
- **/
- bool save();
-
- /**
- * Returns 'true' if there are any changes that need to be written.
- *
- * Always returns 'false' if accessMode() is ReadOnly.
- **/
- bool pendingChanges() const { return _dirty; }
-
- /**
- * Returns the file name.
- **/
- QString fileName() const { return _fileName; }
-
- /**
- * Returns the access mode - one of ReadOnly, ReadWrite, WriteOnly.
- **/
- AccessMode accessMode() const { return _accessMode; }
-
-
-protected:
-
- class Section: public QMap
- {
- public:
- Section( const QString & name )
- : QMap()
- , _name( name )
- {}
- QString name() const { return _name; }
-
- protected:
-
- QString _name;
- };
-
-
-
- /**
- * Initialize the section data
- **/
- void initSections();
-
- /**
- * Read the settings file. Sets _readError depending on success or failure.
- * Returns 'true' upon success.
- **/
- bool load();
-
- /**
- * Save one section to a stream
- **/
- void saveSection( QTextStream & stream, Section * section );
-
-
- //
- // Data members
- //
-
- QString _fileName;
- AccessMode _accessMode;
- bool _readError;
- QString _currentSectionName;
- Section * _currentSection;
- bool _dirty;
-
- Section * _defaultSection;
- QMap _sections;
-
- typedef QMapIterator SectionIterator;
-};
-
-#endif // QY2Settings_h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/YQApplication.cc new/yast2-qt-2.16.49/src/YQApplication.cc
--- old/yast2-qt-2.16.48/src/YQApplication.cc 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/YQApplication.cc 2008-05-17 18:21:39.000000000 +0200
@@ -26,6 +26,10 @@
#include <QFileDialog>
#include <QDesktopWidget>
#include <QMessageBox>
+#include <QSettings>
+#include <QFontDatabase>
+
+#include
#define YUILogComponent "qt-ui"
#include "YUILog.h"
@@ -44,7 +48,6 @@
, _currentFont( 0 )
, _headingFont( 0 )
, _boldFont( 0 )
- , _fontFamily( "Sans Serif" )
, _langFonts( 0 )
, _qtTranslations( 0 )
, _autoFonts( false )
@@ -64,11 +67,8 @@
YQApplication::~YQApplication()
{
- if ( _langFonts )
- delete _langFonts;
-
- if ( _qtTranslations )
- delete _qtTranslations;
+ delete _langFonts;
+ delete _qtTranslations;
deleteFonts();
}
@@ -145,17 +145,20 @@
void
YQApplication::setLangFonts( const string & language, const string & encoding )
{
+ if ( _fontFamily.isEmpty() )
+ _fontFamily = qApp->font().family();
+
QString oldFontFamily = _fontFamily;
if ( ! _langFonts )
{
- _langFonts = new QY2Settings( LANG_FONTS_FILE );
+ _langFonts = new QSettings( LANG_FONTS_FILE, QSettings::IniFormat );
Q_CHECK_PTR( _langFonts );
- if ( _langFonts->readError() )
+ if ( _langFonts->status() != QSettings::NoError )
yuiError() << "Error reading " << _langFonts->fileName() << endl;
else
- yuiMilestone() << _langFonts->fileName() << " read OK" << endl;
+ yuiMilestone() << _langFonts->fileName() << " read OK" << qPrintable( _langFonts->allKeys().join( "-" ) ) << endl;
}
QString lang = language.c_str();
@@ -165,41 +168,64 @@
QString key;
- if ( ! _langFonts->hasKey( fontKey( lang ) ) ) // Try with encoding ("zh_CN.UTF8" etc.)
+ if ( ! _langFonts->contains( fontKey( lang ) ) ) // Try with encoding ("zh_CN.UTF8" etc.)
{
lang = language.c_str(); // Try without encoding ("zh_CN")
- if ( ! _langFonts->hasKey( fontKey( lang ) ) )
+ if ( ! _langFonts->contains( fontKey( lang ) ) )
lang.replace( QRegExp( "_.*$" ), "" ); // Cut off trailing country ("_CN")
}
- if ( _langFonts->hasKey( fontKey( lang ) ) )
+ if ( _langFonts->contains( fontKey( lang ) ) )
{
- _fontFamily = _langFonts->get( fontKey( lang ), "Sans Serif" );
+ _fontFamily = _langFonts->value( fontKey( lang ), _fontFamily ).toString();
yuiMilestone() << fontKey( lang ) << " = \"" << _fontFamily << "\"" << endl;
}
else
{
- _fontFamily = _langFonts->get( fontKey( "" ), "Sans Serif" );
+ _fontFamily = _langFonts->value( fontKey( "" ), _fontFamily ).toString();
yuiMilestone() << "Using fallback for " << lang
<< ": font = \"" << _fontFamily << "\""
<< endl;
}
- if ( _fontFamily != oldFontFamily && ! _fontFamily.isEmpty() )
+ if ( _fontFamily.isEmpty() ) {
+ _fontFamily = "Sans Serif";
+ }
+
+ if ( _fontFamily != oldFontFamily )
{
yuiMilestone() << "New font family: " << _fontFamily << endl;
deleteFonts();
- int size = qApp->font().pointSize();
- QFont font( _fontFamily );
- font.setPointSize( size );
- qApp->setFont(font); // font, informWidgets
+ // setting the language loads fonts and we need to tell fontconfig
+ FcInitReinitialize();
+
+#if 0
+ QFontDatabase database;
+ int ret = database.addApplicationFont( "/usr/share/fonts/truetype/ipag.ttf" );
+ yuiMilestone() << "families " << qPrintable( database.families().join( "-" ) ) << " " << ret << endl;
+#endif
+
+ foreach (QWidget *widget, QApplication::allWidgets())
+ {
+ if ( widget->font().family() != oldFontFamily )
+ continue;
+
+ QFont wfont( widget->font() );
+ wfont.setFamily( _fontFamily );
+ widget->setFont( wfont );
+ }
+ QFont font( qApp->font() );
+ font.setFamily( _fontFamily );
+ qApp->setFont(font); // font, informWidgets
+
yuiMilestone() << "Reloading fonts - now using \"" << font.toString() << "\"" << endl;
}
else
{
yuiDebug() << "No font change" << endl;
}
+
}
@@ -302,14 +328,9 @@
void
YQApplication::deleteFonts()
{
- if ( _currentFont )
- delete _currentFont;
-
- if ( _headingFont )
- delete _headingFont;
-
- if ( _boldFont )
- delete _boldFont;
+ delete _currentFont;
+ delete _headingFont;
+ delete _boldFont;
_currentFont = 0;
_headingFont = 0;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/YQApplication.h new/yast2-qt-2.16.49/src/YQApplication.h
--- old/yast2-qt-2.16.48/src/YQApplication.h 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/YQApplication.h 2008-05-17 18:21:39.000000000 +0200
@@ -25,9 +25,9 @@
#include
#include "YQPackageSelectorPluginStub.h"
-#include "QY2Settings.h"
#include "YApplication.h"
+class QSettings;
class YQPackageSelectorPlugin;
@@ -323,7 +323,7 @@
/**
* Language-specific font settings
**/
- QY2Settings * _langFonts;
+ QSettings * _langFonts;
/**
* Translator for the predefined Qt dialogs
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/YQUI_core.cc new/yast2-qt-2.16.49/src/YQUI_core.cc
--- old/yast2-qt-2.16.48/src/YQUI_core.cc 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/YQUI_core.cc 2008-05-17 18:21:39.000000000 +0200
@@ -43,7 +43,6 @@
#include "utf8.h"
#include "YQDialog.h"
-#include "QY2Settings.h"
using std::max;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/src/YQUI_x11.cc new/yast2-qt-2.16.49/src/YQUI_x11.cc
--- old/yast2-qt-2.16.48/src/YQUI_x11.cc 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/src/YQUI_x11.cc 2008-05-17 18:21:39.000000000 +0200
@@ -35,7 +35,6 @@
#include "YEvent.h"
#include "YQDialog.h"
#include "YQi18n.h"
-#include "QY2Settings.h"
#include "YQUI.h"
// Include low-level X headers AFTER Qt headers:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.48/VERSION.cmake new/yast2-qt-2.16.49/VERSION.cmake
--- old/yast2-qt-2.16.48/VERSION.cmake 2008-05-16 14:00:16.000000000 +0200
+++ new/yast2-qt-2.16.49/VERSION.cmake 2008-05-17 18:21:39.000000000 +0200
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "16")
-SET(VERSION_PATCH "48")
+SET(VERSION_PATCH "49")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org