Hello community,
here is the log from the commit of package yast2-qt
checked in at Mon Dec 31 22:43:43 CET 2007.
--------
--- yast2-qt/yast2-qt.changes 2007-12-21 18:41:55.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-qt/yast2-qt.changes 2007-12-29 14:26:20.000000000 +0100
@@ -1,0 +2,5 @@
+Sat Dec 29 14:25:32 CET 2007 - coolo(a)suse.de
+
+- some fixes in the package selector
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-qt.spec ++++++
--- /var/tmp/diff_new_pack.r29575/_old 2007-12-31 22:43:33.000000000 +0100
+++ /var/tmp/diff_new_pack.r29575/_new 2007-12-31 22:43:33.000000000 +0100
@@ -11,7 +11,7 @@
Name: yast2-qt
Version: 2.16.12
-Release: 1
+Release: 5
License: GPL v2 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -78,6 +78,8 @@
%_libdir/YaST2/plugin/libpy2qt_pkg.so
%changelog
+* Sat Dec 29 2007 - coolo(a)suse.de
+- some fixes in the package selector
* Fri Dec 21 2007 - coolo(a)suse.de
- support `CurrentItem in timezone widget
- fix combobox semantic
++++++ yast2-qt-2.16.12.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPackageSelectorBase.cc new/yast2-qt-2.16.12/src/pkg/YQPackageSelectorBase.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPackageSelectorBase.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPackageSelectorBase.cc 2007-12-29 14:26:18.000000000 +0100
@@ -230,7 +230,7 @@
if ( ! changes ||
( QMessageBox::warning( this, "",
_( "Abandon all changes?" ),
- _( "&OK" ), _( "&Cancel" ), "",
+ _( "&Abandon" ), _( "&Cancel" ), "",
1, // defaultButtonNumber (from 0)
1 ) // escapeButtonNumber
== 0 ) // Proceed upon button #0 ( OK )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPackageSelector.cc new/yast2-qt-2.16.12/src/pkg/YQPackageSelector.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPackageSelector.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPackageSelector.cc 2007-12-29 14:26:18.000000000 +0100
@@ -207,7 +207,7 @@
// Fire up the first dependency check in the main loop.
// Don't do this right away - wait until all initializations are finished.
QTimer::singleShot( 0, this, SLOT( resolveDependencies() ) );
-
+
}
#endif
}
@@ -222,6 +222,7 @@
QSplitter * outer_splitter = new QSplitter( Qt::Horizontal, this );
Q_CHECK_PTR( outer_splitter );
+ outer_splitter->setObjectName( "outer_splitter" );
layout->addWidget(outer_splitter);
@@ -239,27 +240,23 @@
{
QSplitter * splitter = new QSplitter( Qt::Vertical, parent );
Q_CHECK_PTR( splitter );
+ splitter->setObjectName( "leftpanesplitter" );
QWidget * upper_vbox = new QWidget( splitter );
QVBoxLayout *layout = new QVBoxLayout(upper_vbox);
upper_vbox->setLayout(layout);
-
+ layout->setMargin( 0 );
+ layout->setSpacing( 0 );
+
Q_CHECK_PTR( upper_vbox );
layoutFilters( upper_vbox );
addVSpacing( upper_vbox, MARGIN );
- QWidget * lower_vbox = new QWidget( splitter );
- layout = new QVBoxLayout(lower_vbox);
- lower_vbox->setLayout(layout);
-
- addVSpacing( lower_vbox, MARGIN );
- _diskUsageList = new YQPkgDiskUsageList( lower_vbox );
- Q_CHECK_PTR( _diskUsageList );
- layout->addWidget(_diskUsageList);
-
- splitter->setStretchFactor(splitter->indexOf(upper_vbox), 0);
- splitter->setStretchFactor(splitter->indexOf(lower_vbox), 1);
-
+ _diskUsageList = new YQPkgDiskUsageList( splitter );
+
+ splitter->setStretchFactor(splitter->indexOf(upper_vbox), 1);
+ splitter->setStretchFactor(splitter->indexOf( _diskUsageList ), 2);
+
return splitter;
}
@@ -418,14 +415,12 @@
YQPackageSelector::layoutRightPane( QWidget *parent )
{
QWidget * right_pane_vbox = new QWidget( parent );
-
- QVBoxLayout *layout = new QVBoxLayout(right_pane_vbox);
- right_pane_vbox->setLayout(layout);
+
+ QVBoxLayout *layout = new QVBoxLayout( right_pane_vbox );
Q_CHECK_PTR( right_pane_vbox );
layout->setMargin( MARGIN );
-
QSplitter * splitter = new QSplitter( Qt::Vertical, right_pane_vbox );
Q_CHECK_PTR( splitter );
@@ -434,11 +429,11 @@
Q_CHECK_PTR( splitter );
layoutPkgList( splitter );
- addVSpacing( splitter, MARGIN );
+ //addVSpacing( splitter, MARGIN );
layoutDetailsViews( splitter );
- layoutButtons( splitter );
+ layoutButtons( right_pane_vbox );
return right_pane_vbox;
}
@@ -573,11 +568,12 @@
{
QWidget * button_box = new QWidget( parent );
Q_CHECK_PTR( button_box );
+ parent->layout()->addWidget( button_box );
QHBoxLayout *layout = new QHBoxLayout(button_box);
- button_box->setLayout(layout);
- layout->setSpacing( SPACING );
+ //layout->setSpacing( SPACING );
+ layout->setMargin( 0 );
// Button: Dependency check
// Translators: Please keep this short!
@@ -717,7 +713,7 @@
Q_CHECK_PTR( submenu );
submenu->addSeparator();
-
+
_pkgMenu->addAction(_pkgList->actionInstallListSourceRpms);
_pkgMenu->addAction(_pkgList->actionDontInstallListSourceRpms);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPatternSelector.cc new/yast2-qt-2.16.12/src/pkg/YQPatternSelector.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPatternSelector.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPatternSelector.cc 2007-12-29 14:26:18.000000000 +0100
@@ -147,8 +147,8 @@
false, // no autoFill - need to connect to details view first
false ); // no autoFilter - filterMatch() is not connected
Q_CHECK_PTR( _patternList );
- layout->addWidget(_patternList);
- _patternList->header()->hide();
+ layout->addWidget(_patternList);
+ _patternList->header()->hide();
}
if ( ! _patternList )
@@ -168,7 +168,7 @@
false, // no autoFill - need to connect to details view first
false ); // no autoFilter - filterMatch() is not connected
Q_CHECK_PTR( _selList );
- layout->addWidget(_selList);
+ layout->addWidget(_selList);
_selList->header()->hide();
}
@@ -182,11 +182,11 @@
QHBoxLayout * hbox = new QHBoxLayout();
Q_CHECK_PTR( hbox );
- layout->addLayout(hbox);
+ layout->addLayout(hbox);
QPushButton * details_button = new QPushButton( _( "&Details..." ), vbox );
Q_CHECK_PTR( details_button );
- hbox->addWidget(details_button);
+ hbox->addWidget(details_button);
connect( details_button, SIGNAL( clicked() ),
this, SLOT ( detailedPackageSelection() ) );
@@ -212,31 +212,27 @@
//
QWidget *upper_vbox = new QWidget(splitter);
QVBoxLayout * layout = new QVBoxLayout(upper_vbox);
-
+
Q_CHECK_PTR( upper_vbox );
_descriptionView = new YQPkgSelDescriptionView( upper_vbox );
Q_CHECK_PTR( _descriptionView );
layout->addWidget(_descriptionView);
- layout->addSpacing( MARGIN );
-
-
//
// Disk usage
//
QWidget *lower_vbox = new QWidget(splitter);
- layout = new QVBoxLayout(upper_vbox);
+ layout = new QVBoxLayout( lower_vbox);
Q_CHECK_PTR( lower_vbox );
- layout->addSpacing( MARGIN );
_diskUsageList = new YQPkgDiskUsageList( lower_vbox );
Q_CHECK_PTR( _diskUsageList );
layout->addWidget(_diskUsageList);
- splitter->setStretchFactor( 0, 0 );
+ splitter->setStretchFactor( 0, 3 );
splitter->setStretchFactor( 0, 1 );
return splitter;
@@ -248,14 +244,14 @@
YQPatternSelector::layoutButtons( QWidget * parent )
{
QWidget *button_box = new QWidget(parent);
+ Q_CHECK_PTR( button_box );
+
+ parent->layout()->addWidget( button_box );
QHBoxLayout *layout = new QHBoxLayout(button_box);
- Q_CHECK_PTR( button_box );
layout->setMargin ( MARGIN );
layout->setSpacing( SPACING );
- button_box->setLayout(layout);
-
QPushButton * details_button = new QPushButton( _( "&Details..." ), button_box );
layout->addWidget(details_button);
Q_CHECK_PTR( details_button );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPkgChangesDialog.cc new/yast2-qt-2.16.12/src/pkg/YQPkgChangesDialog.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPkgChangesDialog.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPkgChangesDialog.cc 2007-12-29 14:26:18.000000000 +0100
@@ -121,7 +121,7 @@
QPushButton * button = new QPushButton( acceptButtonLabel, this );
Q_CHECK_PTR( button );
- layout->addWidget( button );
+ hbox->addWidget( button );
button->setDefault( true );
connect( button, SIGNAL( clicked() ),
@@ -129,14 +129,13 @@
hbox->addStretch();
-
if ( ! rejectButtonLabel.isEmpty() )
{
// Reject button ( if desired ) - usually "Cancel"
button = new QPushButton( rejectButtonLabel, this );
Q_CHECK_PTR( button );
- hbox->addWidget(button);
+ hbox->addWidget(button);
connect( button, SIGNAL( clicked() ),
this, SLOT ( reject() ) );
@@ -159,7 +158,7 @@
_pkgList->clear();
set<string> ignoredNames;
-
+
if ( ! byUser || ! byApp )
ignoredNames = zypp::ui::userWantedPackageNames();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.cc new/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.cc 2007-12-29 14:26:18.000000000 +0100
@@ -22,7 +22,10 @@
#include <QPixmap>
#include <QDateTime>
#include <QMessageBox>
+#include <QRadioButton>
#include <QList>
+#include <QDebug>
+#include <QVBoxLayout>
#include <errno.h>
@@ -56,12 +59,16 @@
YQPkgConflictList::YQPkgConflictList( QWidget * parent )
- : QY2ListView( parent )
+ : QScrollArea( parent ), _layout( 0 )
{
+ setWidget( new QFrame( this ) );
+ _layout = new QVBoxLayout;
+ widget()->setLayout( _layout );
+ clear();
- setHeaderLabel( _( "Dependency Conflict" ) );
- setRootIsDecorated( true );
- setSortByInsertionSequence( true );
+ //setHeaderLabel( _( "Dependency Conflict" ) );
+ //setRootIsDecorated( true );
+ //setSortByInsertionSequence( true );
}
@@ -70,6 +77,19 @@
// NOP
}
+void
+YQPkgConflictList::clear()
+{
+ YQPkgConflict * conflict;
+ foreach( conflict, _conflicts )
+ {
+ _layout->removeWidget( conflict );
+ delete conflict;
+ }
+ _conflicts.clear();
+ // kill the stretch item too
+ delete _layout->takeAt( 0 );
+}
void
YQPkgConflictList::fill( zypp::ResolverProblemList problemList )
@@ -77,16 +97,27 @@
clear();
string text;
+ // for some weired reason, the layout's minSize is still 18x18 even after 3000 pixels
+ // inserted, so we have to do the math on our own
+ QSize minSize = QSize( _layout->margin() * 2, _layout->margin() * 2 );
zypp::ResolverProblemList::iterator it = problemList.begin();
while ( it != problemList.end() )
{
- YQPkgConflict * conflict = new YQPkgConflict( this, *it );
+ YQPkgConflict *conflict = new YQPkgConflict( widget(), *it );
Q_CHECK_PTR( conflict );
+ minSize = minSize.expandedTo( conflict->minimumSizeHint() );
+ minSize.rheight() += conflict->minimumSizeHint().height() + _layout->spacing();
+ _layout->addWidget( conflict );
+ _conflicts.push_back( conflict );
++it;
}
+ _layout->addStretch( 1 );
+
+ widget()->resize( minSize );
+ setWidgetResizable( false );
}
@@ -95,26 +126,16 @@
{
zypp::ProblemSolutionList userChoices;
- int count=0;
- QTreeWidgetItem * child;
-
- while ( (child = topLevelItem(count)) )
+ YQPkgConflict *conflict;
+ foreach( conflict, _conflicts )
{
- YQPkgConflict * conflict = dynamic_cast<YQPkgConflict *> (child);
+ zypp::ProblemSolution_Ptr userChoice = conflict->userSelectedResolution();
- if ( conflict )
- {
- zypp::ProblemSolution_Ptr userChoice = conflict->userSelectedResolution();
-
- if ( userChoice )
- userChoices.push_back( userChoice );
- }
-
- count++;
+ if ( userChoice )
+ userChoices.push_back( userChoice );
}
zypp::getZYpp()->resolver()->applySolutions( userChoices );
-
emit updatePackages();
}
@@ -133,9 +154,10 @@
void
YQPkgConflictList::saveToFile( const QString filename, bool interactive ) const
{
+#if 0
// Open file
QFile file(filename);
-
+
if ( ! file.open(QIODevice::WriteOnly) )
{
y2error( "Can't open file %s", qPrintable(filename) );
@@ -184,12 +206,14 @@
if ( file.isOpen() )
file.close();
+
+#endif
}
void
YQPkgConflictList::saveItemToFile( QFile &file,
- const QTreeWidgetItem * item ) const
+ const YQPkgConflict * item ) const
{
#if FIXME
if ( ! item || ! file.isOpen() )
@@ -207,7 +231,7 @@
{
switch ( checkListItem->type() )
{
- QString buffer;
+ QString buffer;
case Q3CheckListItem::CheckBox:
buffer.sprintf( "[%c] ", checkListItem->( checkState(0) == Qt::Checked ) ? 'x' : ' ' );
break;
@@ -238,178 +262,96 @@
#endif
}
-
-void
-YQPkgConflictList::dumpList( QTreeWidgetItem * parent,
- const QString & longText,
- const QString & header,
- int splitThreshold )
-{
- if ( ! parent )
- {
- y2error( "Null parent" );
- return;
- }
-
- if ( longText.isEmpty() )
- return;
-
-#if FIXME
- if ( ! header.isEmpty() )
- {
- parent = new QY2ListViewItem( parent, header );
- Q_CHECK_PTR( parent );
- parent->setExpanded( true );
- }
-
- QStringList lines = QStringList::split( '\n', longText,
- true ); // allowEmptyEntries
- QList<QString>::const_iterator it = lines.begin();
-
- bool doSplit = splitThreshold > 1 && lines.size() > splitThreshold + 3;
- bool didSplit = false;
- int count = 0;
-
-
- while ( it != lines.end() )
- {
- if ( doSplit && ! didSplit && ++count > splitThreshold )
- {
- // Split list
-
- int more = lines.size() - count + 1;
- QString text = ( _( "%1 more..." ) ).arg( more );
- QY2ListViewItem * sublist = new QY2ListViewItem( parent, text );
- didSplit = true;
-
- if ( sublist )
- {
- sublist->setBackgroundColor( LIGHT_ORANGE );
- parent = sublist;
- }
- }
-
- new QY2ListViewItem( parent, *it );
- ++it;
- }
-#endif
-}
-
-
-
-
-
-
-
-YQPkgConflict::YQPkgConflict( YQPkgConflictList * parentList,
+YQPkgConflict::YQPkgConflict( QWidget * parent,
zypp::ResolverProblem_Ptr problem )
- : QY2ListViewItem( parentList )
+ : QFrame( parent )
, _problem( problem )
, _resolutionsHeader( 0 )
{
- setBackgroundColor( LIGHT_BLUE );
- setExpanded( true );
-
+ _layout = new QVBoxLayout( this );
+ _layout->setSpacing( 0 );
+ _layout->setMargin( 0 );
formatHeading();
- YQPkgConflictList::dumpList( this, fromUTF8( _problem->details() ) );
+ QLabel *label = new QLabel( fromUTF8 ( _problem->details() ), this );
+ _layout->addWidget( label );
+ //YQPkgConflictList::dumpList( this, );
addSolutions();
+ setMinimumSize( _layout->minimumSize() );
}
void
YQPkgConflict::formatHeading()
{
- QString text;
- QPixmap icon = YQIconPool::normalPkgConflict();
- setTextColor( BRIGHT_RED );
+ QFrame *frame = new QFrame( this );
+ QHBoxLayout *hbox = new QHBoxLayout(frame);
+
+ QLabel *pix = new QLabel( this );
+ pix->setPixmap( YQIconPool::normalPkgConflict() );
+
+ hbox->addWidget( pix );
- setData( 0, Qt::DisplayRole, fromUTF8( problem()->description() ) );
- setData( 0, Qt::DecorationRole, icon );
+ QString text = fromUTF8( problem()->description() );
+ QLabel *heading = new QLabel( text, this );
+ heading->setStyleSheet( "font-size: +2; color: red; font: bold;" );
+ hbox->addWidget( heading );
+ hbox->addStretch( 1 );
+
+ frame->setStyleSheet( "background-color: lightgray;" );
+ _layout->addWidget(frame);
}
void
YQPkgConflict::addSolutions()
{
- _resolutionsHeader = new QY2CheckListItem( this,
- // Heading for the choices
- // how to resolve this conflict
- _( "Conflict Resolution:" ) );
+ // Heading for the choices
+ // how to resolve this conflict
+ _resolutionsHeader = new QLabel( _( "Conflict Resolution:" ), this );
+ _layout->addWidget( _resolutionsHeader );
Q_CHECK_PTR( _resolutionsHeader );
- _resolutionsHeader->setExpanded( true );
- _resolutionsHeader->setBackgroundColor( LIGHT_GREY );
-
zypp::ProblemSolutionList solutions = problem()->solutions();
zypp::ProblemSolutionList::iterator it = solutions.begin();
+ QHBoxLayout *hbox = new QHBoxLayout();
+ hbox->addSpacing( 20 );
+
+ QVBoxLayout *vbox = new QVBoxLayout();
+ hbox->addLayout( vbox );
+ _layout->addLayout( hbox );
+
while ( it != solutions.end() )
{
- YQPkgConflictResolution * solution = new YQPkgConflictResolution( _resolutionsHeader, *it );
- Q_CHECK_PTR( solution );
- //FIXME solution->setExpanded(true);
+ QRadioButton * s = new QRadioButton( fromUTF8( ( *it )->description() ), this );
+ Q_CHECK_PTR( s );
+ _solutions[ s ] = *it;
+ vbox->addWidget( s );
++it;
}
}
-
-// void
-// YQPkgConflict::paintCell( QPainter * painter,
-// const QColorGroup & colorGroup,
-// int column,
-// int width,
-// int alignment )
-// {
-// painter->setFont( YQUI::yqApp()->headingFont() );
-// #if FIXME
-// QY2ListViewItem::paintCell( painter, colorGroup, column, width, alignment );
-// #endif
-// }
-
-
zypp::ProblemSolution_Ptr
YQPkgConflict::userSelectedResolution()
{
- QTreeWidgetItem * item;
- QTreeWidgetItemIterator it(_resolutionsHeader);
+ QMap<QRadioButton*, zypp::ProblemSolution_Ptr>::iterator it;
- while ( (item = *it) )
+ for ( it = _solutions.begin(); it != _solutions.end(); ++it )
{
- YQPkgConflictResolution * res = dynamic_cast<YQPkgConflictResolution *> (item);
-
- if ( res && ( res->checkState(0) == Qt::Checked ) )
- {
- zypp::ProblemSolution_Ptr solution = res->solution();
-
- y2milestone( "User selected resolution \"%s\" for problem \"%s\"",
- solution->description().c_str(),
- solution->problem()->description().c_str() );
- return solution;
- }
-
- ++it;
+ QRadioButton *button = it.key();
+ if ( !button->isChecked() )
+ continue;
+ zypp::ProblemSolution_Ptr solution = it.value();
+
+ y2milestone( "User selected resolution \"%s\" for problem \"%s\"",
+ solution->description().c_str(),
+ solution->problem()->description().c_str() );
+ return solution;
}
return zypp::ProblemSolution_Ptr(); // Null pointer
}
-
-
-
-
-
-YQPkgConflictResolution::YQPkgConflictResolution( QY2CheckListItem * parent,
- zypp::ProblemSolution_Ptr solution )
- : QY2CheckListItem( parent,
- fromUTF8( solution->description() ) )
- /*, Q3CheckListItem::RadioButton) */
-{
- _solution = solution;
- YQPkgConflictList::dumpList( this, fromUTF8( solution->details() ) );
-}
-
-
-
#include "YQPkgConflictList.moc"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.h new/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.h
--- old/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.h 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPkgConflictList.h 2007-12-29 14:26:18.000000000 +0100
@@ -24,13 +24,14 @@
#include <stdio.h>
#include <QMap>
#include <QFile>
-#include "QY2ListView.h"
+#include <QScrollArea>
#include <zypp/Resolver.h>
#include <zypp/ResolverProblem.h>
#include <zypp/ProblemSolution.h>
-
+class QVBoxLayout;
+class QRadioButton;
class QAction;
class YQPkgConflict;
class YQPkgConflictResolution;
@@ -41,7 +42,7 @@
* @short Display package dependency conflicts in a tree list and let the user
* choose how to resolve each conflict.
**/
-class YQPkgConflictList : public QY2ListView
+class YQPkgConflictList : public QScrollArea
{
Q_OBJECT
@@ -64,12 +65,12 @@
/**
* Check if the conflict list is empty.
**/
- bool isEmpty() const { return topLevelItemCount() == 0; }
+ bool isEmpty() const { return count() == 0; }
/**
* Returns the number of conflicts in the list.
**/
- int count() const { return topLevelItemCount(); }
+ int count() const { return _conflicts.count(); }
public slots:
@@ -89,6 +90,7 @@
**/
void askSaveToFile() const;
+ void clear();
public:
@@ -102,25 +104,15 @@
**/
void saveToFile( const QString filename, bool interactive ) const;
- /**
- * Dump a multi-line text to a QListView as a sequence of separate items.
- * If 'longText' has considerably more lines than 'splitThreshold', fold
- * all lines from no. 'splitThreshold' on into a closed list item
- * "More...".
- * If 'header' is not empty, it will be added as the parent of the lines.
- **/
- static void dumpList( QTreeWidgetItem * parent,
- const QString & longText,
- const QString & header = QString::null,
- int splitThreshold = 3 );
-
protected:
/**
* (Recursively) save one item to file.
**/
- void saveItemToFile( QFile &file, const QTreeWidgetItem * item ) const;
+ void saveItemToFile( QFile &file, const YQPkgConflict * item ) const;
+ QList<YQPkgConflict*> _conflicts;
+ QVBoxLayout *_layout;
signals:
@@ -128,6 +120,7 @@
* Update package states - they may have changed.
**/
void updatePackages();
+
};
@@ -135,14 +128,16 @@
/**
* @short Root item for each individual conflict
**/
-class YQPkgConflict: public QY2ListViewItem
+class YQPkgConflict: public QFrame
{
+ Q_OBJECT
+
public:
/**
* Constructor.
**/
- YQPkgConflict( YQPkgConflictList * parentList,
+ YQPkgConflict( QWidget *parent,
zypp::ResolverProblem_Ptr problem );
/**
@@ -174,49 +169,13 @@
**/
void addSolutions();
- /**
- * Paint method. Reimplemented from @ref QListViewItem so a different
- * font can be used.
- *
- * Reimplemented from QY2ListViewItem.
- **/
-// virtual void paintCell( QPainter * painter,
-// const QColorGroup & colorGroup,
-// int column,
-// int width,
-// int alignment );
-
-
// Data members
zypp::ResolverProblem_Ptr _problem;
- QY2CheckListItem * _resolutionsHeader;
-};
-
-
-
-class YQPkgConflictResolution: public QY2CheckListItem
-{
-public:
-
- /**
- * Constructor
- **/
- YQPkgConflictResolution( QY2CheckListItem * parent,
- zypp::ProblemSolution_Ptr _solution );
-
- /**
- * Return the corresponding ProblemSolution.
- **/
- zypp::ProblemSolution_Ptr solution() const { return _solution; }
-
-
-protected:
-
- // Data members
-
- zypp::ProblemSolution_Ptr _solution;
+ QLabel * _resolutionsHeader;
+ QList<zypp::ProblemSolution_Ptr> _resolutions;
+ QMap<QRadioButton*, zypp::ProblemSolution_Ptr> _solutions;
+ QVBoxLayout *_layout;
};
-
#endif // ifndef YQPkgConflictList_h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPkgDiskUsageList.cc new/yast2-qt-2.16.12/src/pkg/YQPkgDiskUsageList.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPkgDiskUsageList.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPkgDiskUsageList.cc 2007-12-29 14:26:18.000000000 +0100
@@ -86,7 +86,18 @@
_items.insert( QString::fromUtf8(partitionDu.dir.c_str()), item );
}
}
-
+ resizeColumnToContents( nameCol() );
+ resizeColumnToContents( usedSizeCol() );
+ resizeColumnToContents( freeSizeCol() );
+ resizeColumnToContents( totalSizeCol() );
+
+ sortByColumn( percentageBarCol(), Qt::DescendingOrder );
+
+ header()->setResizeMode( percentageBarCol(), QHeaderView::Stretch );
+ header()->setResizeMode( totalSizeCol(), QHeaderView::Fixed );
+ header()->setResizeMode( nameCol(), QHeaderView::ResizeToContents );
+ header()->setResizeMode( usedSizeCol(), QHeaderView::ResizeToContents );
+ header()->setResizeMode( freeSizeCol(), QHeaderView::ResizeToContents );
}
@@ -111,9 +122,7 @@
y2error( "No entry for mount point %s", partitionDu.dir.c_str() );
}
-#if FIXME
- sort();
-#endif
+ resizeColumnToContents( totalSizeCol() );
postPendingWarnings();
}
@@ -148,6 +157,8 @@
QSize
YQPkgDiskUsageList::sizeHint() const
{
+ QFontMetrics fms( font() );
+ return QSize( fms.width( "/var/usr/home 100% 100.32GB" ) + 50, 100 );
#ifdef FIXME
int width = header()->headerWidth()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPkgList.cc new/yast2-qt-2.16.12/src/pkg/YQPkgList.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPkgList.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPkgList.cc 2007-12-29 14:26:18.000000000 +0100
@@ -27,6 +27,9 @@
#include <QMenu>
#include <QMessageBox>
#include <QFile>
+#include <QTreeView>
+#include <QDebug>
+#include <QHeaderView>
#include "utf8.h"
@@ -45,9 +48,8 @@
int numCol = 0;
QStringList headers;
-
+
headers << ""; _statusCol = numCol++;
- // _statusCol = numCol;
headers << _( "Package" ); _nameCol = numCol++;
headers << _( "Summary" ); _summaryCol = numCol++;
@@ -70,11 +72,29 @@
headers << _( "Source" ); _srpmStatusCol = numCol++;
#endif
setHeaderLabels(headers);
- saveColumnWidths();
- //FIXME sort( nameCol() );
- //FIXME setColumnAlignment( sizeCol(), Qt::AlignRight );
+
+ setSortingEnabled( true );
+ header()->setSortIndicatorShown( true );
+ header()->setClickable( true );
+
+ sortByColumn( nameCol(), Qt::AscendingOrder );
+
setAllColumnsShowFocus( true );
+ setIconSize( QSize( 22, 16 ) );
+ // resize to minimum
+ setColumnWidth( statusCol(), 25 );
+ QFontMetrics fms( font() );
+ setColumnWidth( sizeCol(), fms.width( "8780.2 K" ) );
+ setColumnWidth( instVersionCol(), fms.width( " 20071220pre" ) );
+ setColumnWidth( versionCol(), fms.width( " 20071220pre" ) );
+ setColumnWidth( nameCol(), fms.width( "opensuse-release " ) );
+ setColumnWidth( summaryCol(), fms.width( "A really really long text, but not too long" ) );
+
+ header()->setResizeMode( QHeaderView::Interactive );
+
+ saveColumnWidths();
+
createActions();
createSourceRpmContextMenu();
@@ -437,7 +457,7 @@
if ( instVersion.isEmpty() ) instVersion = "---";
QString status = "[" + statusText( pkg->status() ) + "]";
- QString format;
+ QString format;
format.sprintf("%-20s %-30s | %10s | %-16s | %-16s\n",
(const char *) status.toUtf8(),
(const char *) pkg->text( nameCol() ),
@@ -445,7 +465,7 @@
(const char *) candVersion,
(const char *) instVersion
);
- file.write(format.toUtf8());
+ file.write(format.toUtf8());
}
item = item->nextSibling();
@@ -455,7 +475,7 @@
// Clean up
if ( file.isOpen() )
- file.close();
+ file.close();
}
@@ -552,6 +572,9 @@
_zyppPkg = tryCastToZyppPkg( selectable->theObj() );
setSourceRpmIcon();
+
+ setTextAlignment( sizeCol(), Qt::AlignRight );
+ setSizeHint( sizeCol(), QSize( QFontMetrics( pkgList->font() ).width( text( sizeCol() ) ), 10 ) );
}
@@ -731,11 +754,11 @@
bool YQPkgListItem::operator< ( const QTreeWidgetItem & otherListViewItem ) const
{
+ const YQPkgListItem * other = dynamic_cast<const YQPkgListItem *> (&otherListViewItem);
+
int col = treeWidget()->sortColumn();
if ( col == srpmStatusCol() )
{
- const YQPkgListItem * other = dynamic_cast<const YQPkgListItem *> (&otherListViewItem);
-
if ( other )
{
int thisPoints = ( this->hasSourceRpm() ? 1 : 0 ) + ( this->installSourceRpm() ? 1 : 0 );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPkgObjList.cc new/yast2-qt-2.16.12/src/pkg/YQPkgObjList.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPkgObjList.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPkgObjList.cc 2007-12-29 14:26:18.000000000 +0100
@@ -24,8 +24,8 @@
#include <QHeaderView>
#include <QMenu>
#include <QAction>
-//Added by qt3to4:
-#include <qevent.h>
+#include <QDebug>
+#include <QKeyEvent>
#include "utf8.h"
@@ -90,6 +90,7 @@
connect( this, SIGNAL( currentItemChanged ( QTreeWidgetItem *, QTreeWidgetItem * ) ),
this, SLOT ( currentItemChangedInternal( QTreeWidgetItem * ) ) );
+
}
@@ -128,7 +129,6 @@
if ( sizeCol() >= 0 && size > 0L )
{
QString sizeStr = size.form().c_str();
- sizeStr += " ";
item->setText( sizeCol(), sizeStr );
}
}
@@ -366,7 +366,7 @@
//item->setSelected( false ); // Doesn't emit signals
scrollToItem( *it ); // Scroll if necessary
setCurrentItem( *it ); // Emits signals
-
+
}
}
@@ -775,7 +775,6 @@
}
}
-
void
YQPkgObjList::applyExcludeRules( QTreeWidgetItem * listViewItem )
{
@@ -924,7 +923,7 @@
zypp::ByteCount size = zyppObj()->size();
if ( size > 0L )
- setText( sizeCol(), size.asString() + " " );
+ setText( sizeCol(), size.asString() );
}
if ( instVersionCol() >= 0 )
@@ -947,6 +946,7 @@
setText( versionCol(), zyppObj()->edition() );
}
+
setStatusIcon();
}
@@ -1048,14 +1048,14 @@
if ( statusCol() >= 0 )
{
bool enabled = editable() && _pkgObjList->editable();
- setData( statusCol(), Qt::DecorationRole, _pkgObjList->statusIcon( status(), enabled, bySelection() ) );
+ setIcon( statusCol(), _pkgObjList->statusIcon( status(), enabled, bySelection() ) );
}
if ( brokenIconCol() >= 0 )
{
// Reset this icon now - it might be the same column as satisfiedIconCol()
- setData( brokenIconCol(), Qt::DecorationRole, QPixmap() );
+ setIcon( brokenIconCol(), QPixmap() );
}
if ( satisfiedIconCol() >= 0 )
@@ -1064,7 +1064,7 @@
// but satisfied anyway (e.g. for patches or patterns where the user
// selected all required packages manually)
- setData( satisfiedIconCol(), Qt::DecorationRole, isSatisfied() ? YQIconPool::pkgSatisfied() : QPixmap() );
+ setIcon( satisfiedIconCol(), isSatisfied() ? YQIconPool::pkgSatisfied() : QPixmap() );
}
if ( brokenIconCol() >= 0 )
@@ -1074,7 +1074,7 @@
if ( isBroken() )
{
- setData( brokenIconCol(), Qt::DecorationRole, YQIconPool::warningSign() );
+ setIcon( brokenIconCol(), YQIconPool::warningSign() );
y2warning( "Broken object: %s - %s",
_selectable->theObj()->name().c_str(),
_selectable->theObj()->summary().c_str() );
@@ -1380,7 +1380,7 @@
if ( col == sizeCol() )
{
// Numeric sort by size
-
+
return ( this->zyppObj()->size() < other->zyppObj()->size() );
}
else if ( col == statusCol() )
@@ -1391,7 +1391,10 @@
// dangerous or noteworthy states first - e.g., "taboo" which should
// seldeom occur, but when it does, it is important.
- return ( this->status() < other->status() );
+ bool b = ( this->status() < other->status() );
+ if ( !b && this->status() == other->status() )
+ b = this->zyppObj()->name() < other->zyppObj()->name();
+ return b;
}
else if ( col == instVersionCol() ||
col == versionCol() )
@@ -1439,9 +1442,6 @@
_excluded = excl;
}
-
-
-
YQPkgObjList::ExcludeRule::ExcludeRule( YQPkgObjList * parent,
const QRegExp & regexp,
int column )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/pkg/YQPkgPatternList.cc new/yast2-qt-2.16.12/src/pkg/YQPkgPatternList.cc
--- old/yast2-qt-2.16.12/src/pkg/YQPkgPatternList.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/pkg/YQPkgPatternList.cc 2007-12-29 14:26:18.000000000 +0100
@@ -139,7 +139,6 @@
_categories.insert( categoryName, cat );
}
-
return cat;
}
@@ -342,11 +341,6 @@
return QTreeWidgetItem::operator<( otherListViewItem );
}
-
-
-
-
-
YQPkgPatternCategoryItem::YQPkgPatternCategoryItem( YQPkgPatternList * patternList,
const QString & category )
: QY2ListViewItem( patternList )
@@ -390,10 +384,10 @@
void
YQPkgPatternCategoryItem::setTreeIcon()
{
- setData( _patternList->statusCol(), Qt::DecorationRole,
- isExpanded() ?
- YQIconPool::treeMinus() :
- YQIconPool::treePlus() );
+ setIcon( _patternList->statusCol(),
+ isExpanded() ?
+ YQIconPool::treeMinus() :
+ YQIconPool::treePlus() );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/QY2ComboTabWidget.cc new/yast2-qt-2.16.12/src/QY2ComboTabWidget.cc
--- old/yast2-qt-2.16.12/src/QY2ComboTabWidget.cc 2007-12-21 18:41:52.000000000 +0100
+++ new/yast2-qt-2.16.12/src/QY2ComboTabWidget.cc 2007-12-29 14:26:17.000000000 +0100
@@ -42,26 +42,25 @@
const char * name )
: QWidget(parent)
{
- QVBoxLayout *vbox = new QVBoxLayout();
- setLayout(vbox);
+ QVBoxLayout *vbox = new QVBoxLayout(this);
+ vbox->setMargin( 0 );
QHBoxLayout *hbox = new QHBoxLayout();
Q_CHECK_PTR( hbox );
// hbox->setFrameStyle( QFrame::Panel | QFrame::Raised );
// hbox->setLineWidth(2);
// hbox->setMidLineWidth(2);
- hbox->setSpacing( SPACING );
- hbox->setMargin ( MARGIN );
+ hbox->setSpacing( 0 );
+ hbox->setMargin ( 0 );
vbox->addLayout(hbox);
//this->setSpacing( SPACING );
- this->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert
-
+ this->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) ); // hor/vert
combo_label = new QLabel(label);
hbox->addWidget(combo_label);
Q_CHECK_PTR( combo_label );
-
+
combo_box = new QComboBox( this );
Q_CHECK_PTR( combo_box );
hbox->addWidget(combo_box);
@@ -69,7 +68,7 @@
combo_box->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert
connect( combo_box, SIGNAL( activated( int ) ),
this, SLOT ( showPageIndex ( int ) ) );
-
+
widget_stack = new QStackedWidget( this );
Q_CHECK_PTR( widget_stack );
vbox->addWidget(widget_stack);
@@ -79,7 +78,7 @@
QY2ComboTabWidget::~QY2ComboTabWidget()
{
-
+
}
@@ -125,9 +124,9 @@
// correct combo box item.
return;
}
-
+
// Search the dict for this page
-
+
QHashIterator<int, QWidget *> it( pages );
while ( it.hasNext() )
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/QY2DiskUsageList.cc new/yast2-qt-2.16.12/src/QY2DiskUsageList.cc
--- old/yast2-qt-2.16.12/src/QY2DiskUsageList.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/QY2DiskUsageList.cc 2007-12-29 14:26:19.000000000 +0100
@@ -132,14 +132,12 @@
QY2DiskUsageListItem *item = dynamic_cast<QY2DiskUsageListItem *>(_view->itemFromIndex(index));
if ( item )
{
- item->paintPercentageBar( item->usedPercent(),
- painter,
+ item->paintPercentageBar( painter,
option,
interpolateColor( item->usedPercent(),
- 60, 95,
- QColor( 0, 0x80, 0 ), // Medium dark green
- QColor( 0xFF, 0, 0 ) ), // Bright red
- background.dark( 115 ) );
+ 60, 95,
+ QColor( 0, 0xa0, 0 ), // Medium dark green
+ QColor( 0xFF, 0, 0 ) ) ); // Bright red
}
painter->restore();
}
@@ -150,7 +148,6 @@
{
_nameCol = -42;
_percentageBarCol = -42;
- _percentageCol = -42;
_usedSizeCol = -42;
_freeSizeCol = -42;
_totalSizeCol = -42;
@@ -163,7 +160,6 @@
columnLabels << _( "Name" ); _nameCol = numCol++;
// Translators: Please keep this short!
columnLabels << _("Disk Usage"); _percentageBarCol = numCol++;
- columnLabels << ""; _percentageCol = numCol++;
setItemDelegateForColumn( _percentageBarCol, new QY2DiskUsagePercentageItem( this ) );
columnLabels << _("Used"); _usedSizeCol = numCol++;
columnLabels << _( "Free"); _freeSizeCol = numCol++;
@@ -175,12 +171,8 @@
setColumnCount(numCol);
setHeaderLabels(columnLabels);
- //FIXME
-// setTextAlignment( percentageCol(), Qt::AlignRight );
-// setTextAlignment( usedSizeCol(), Qt::AlignRight );
-// setTextAlignment( freeSizeCol(), Qt::AlignRight );
-// setTextAlignment( totalSizeCol(), Qt::AlignRight );
sortItems( percentageBarCol(), Qt::AscendingOrder );
+ setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum );
}
saveColumnWidths();
@@ -222,12 +214,11 @@
void
QY2DiskUsageListItem::init( bool allFields )
{
- if ( percentageCol() >= 0 )
- {
- QString percentageText;
- percentageText.sprintf( "%d%%", usedPercent() );
- setText( percentageCol(), percentageText );
- }
+ setSizeHint( percentageBarCol(), QSize( 20, 10 ) );
+
+ setTextAlignment( usedSizeCol(), Qt::AlignRight );
+ setTextAlignment( freeSizeCol(), Qt::AlignRight );
+ setTextAlignment( totalSizeCol(), Qt::AlignRight );
if ( usedSizeCol() >= 0 ) setText( usedSizeCol(), usedSize() );
if ( freeSizeCol() >= 0 ) setText( freeSizeCol(), freeSize() );
@@ -235,7 +226,7 @@
if ( allFields )
{
if ( totalSizeCol() >= 0 ) setText( totalSizeCol(), totalSize() );
- if ( nameCol() >= 0 ) setText( nameCol(), " " + name() );
+ if ( nameCol() >= 0 ) setText( nameCol(), name() );
if ( deviceNameCol() >= 0 ) setText( deviceNameCol(), deviceName() );
}
}
@@ -245,7 +236,6 @@
QY2DiskUsageListItem::setText( int column, const FSize & size )
{
QString sizeText = size.form( 0, 1, true ).c_str();
- sizeText += " ";
setText( column, sizeText );
}
@@ -290,7 +280,7 @@
* Comparison function used for sorting the list.
* Reimplemented from QTreeWidgetItem
**/
-bool
+bool
QY2DiskUsageListItem::operator<( const QTreeWidgetItem & otherListViewItem ) const
{
const QY2DiskUsageListItem * other = dynamic_cast<const QY2DiskUsageListItem *> (&otherListViewItem);
@@ -298,8 +288,7 @@
if ( other )
{
- if ( col == percentageCol() ||
- col == percentageBarCol() )
+ if ( col == percentageBarCol() )
{
// Intentionally reverting sort order: Fullest first
return ( this->usedPercent() < other->usedPercent() );
@@ -325,91 +314,44 @@
* Stolen from KDirStat::KDirTreeView with the author's permission.
**/
void
-QY2DiskUsageListItem::paintPercentageBar( float percent,
- QPainter * painter,
+QY2DiskUsageListItem::paintPercentageBar( QPainter * painter,
QStyleOptionViewItem option,
- const QColor & fillColor,
- const QColor & barBackground )
+ const QColor & fillColor )
{
- if ( percent > 100.0 ) percent = 100.0;
- if ( percent < 0.0 ) percent = 0.0;
- int penWidth = 2;
- int extraMargin = 3;
- int x = option.rect.left(); /*FIXME _diskUsageList->itemMargin(); */
- int y = option.rect.top() + extraMargin;
- int w = option.rect.width() - 2; /*FIXME * _diskUsageList->horizontalOffset(); */
- int h = option.rect.height() - 2; /*FIXME * extraMargin; */
- int fillWidth;
-
- painter->eraseRect( option.rect );
- int indent=0;
- w -= indent;
- x += indent;
-
- if ( w > 0 )
- {
- QPen pen( painter->pen() );
- pen.setWidth(0);
- painter->setPen( pen );
- painter->setBrush( Qt::NoBrush );
- fillWidth = (int) ( ( w - 2 * penWidth ) * percent / 100.0 );
-
-
- // Fill bar background.
-
- painter->fillRect( x + penWidth, y + penWidth,
- w - 2 * penWidth + 1, h - 2 * penWidth + 1,
- barBackground );
- /*
- * Notice: The Xlib XDrawRectangle() function always fills one
- * pixel less than specified. Altough this is very likely just a
- * plain old bug, it is documented that way. Obviously, Qt just
- * maps the fillRect() call directly to XDrawRectangle() so they
- * inherited that bug ( although the Qt doc stays silent about
- * it ). So it is really necessary to compensate for that missing
- * pixel in each dimension.
- *
- * If you don't believe it, see for yourself.
- * Hint: Try the xmag program to zoom into the drawn pixels.
- **/
+ float percent = usedPercent();
+ if ( percent > 100.0 ) percent = 100.0;
+ if ( percent < 0.0 ) percent = 0.0;
+ int x = option.rect.left() + 1;
+ int y = option.rect.top() + 1;
+ int w = option.rect.width() - 2;
+ int h = option.rect.height() - 2;
+ int fillWidth = 0;
+
+ if ( w > 0 )
+ {
+ fillWidth = (int) ( w * usedPercent() / 100.0 );
// Fill the desired percentage.
- painter->fillRect( x + penWidth, y + penWidth,
- fillWidth+1, h - 2 * penWidth+1,
+ painter->fillRect( x, y, fillWidth, h,
fillColor );
+ QString percentageText;
+ percentageText.sprintf( "%d%%", usedPercent() );
- // Draw 3D shadows.
+ if ( usedPercent() > 50 ) {
+ painter->setPen( treeWidget()->palette().color( QPalette::Base ) );
+ painter->drawText( QRect( x, y,
+ fillWidth - 3, h ),
+ Qt::AlignRight, percentageText );
+ } else {
+ painter->setPen( treeWidget()->palette().color( QPalette::Text ) );
+ painter->drawText( QRect( x + fillWidth + 3, y,
+ w - fillWidth - 3, h ),
+ Qt::AlignLeft, percentageText );
- pen.setColor( contrastingColor ( Qt::black,
- painter->background().color() ) );
- painter->setPen( pen );
- painter->drawLine( x, y, x+w, y );
- painter->drawLine( x, y, x, y+h );
-
- pen.setColor( contrastingColor( barBackground.dark(),
- painter->background().color() ) );
- painter->setPen( pen );
- painter->drawLine( x+1, y+1, x+w-1, y+1 );
- painter->drawLine( x+1, y+1, x+1, y+h-1 );
-
- pen.setColor( contrastingColor( barBackground.light(),
- painter->background().color() ) );
- painter->setPen( pen );
- painter->drawLine( x+1, y+h, x+w, y+h );
- painter->drawLine( x+w, y, x+w, y+h );
-
- pen.setColor( contrastingColor( Qt::white,
- painter->background().color() ) );
- painter->setPen( pen );
- painter->drawLine( x+2, y+h-1, x+w-1, y+h-1 );
- painter->drawLine( x+w-1, y+1, x+w-1, y+h-1 );
- }
+ }
+ }
}
-
-
-
-
#include "QY2DiskUsageList.moc"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/QY2DiskUsageList.h new/yast2-qt-2.16.12/src/QY2DiskUsageList.h
--- old/yast2-qt-2.16.12/src/QY2DiskUsageList.h 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/QY2DiskUsageList.h 2007-12-29 14:26:17.000000000 +0100
@@ -57,7 +57,6 @@
int nameCol() const { return _nameCol; }
int percentageBarCol() const { return _percentageBarCol; }
- int percentageCol() const { return _percentageCol; }
int usedSizeCol() const { return _usedSizeCol; }
int freeSizeCol() const { return _freeSizeCol; }
int totalSizeCol() const { return _totalSizeCol; }
@@ -74,7 +73,6 @@
int _nameCol;
int _percentageBarCol;
- int _percentageCol;
int _usedSizeCol;
int _freeSizeCol;
int _totalSizeCol;
@@ -200,7 +198,6 @@
int nameCol() const { return _diskUsageList->nameCol(); }
int percentageBarCol() const { return _diskUsageList->percentageBarCol(); }
- int percentageCol() const { return _diskUsageList->percentageCol(); }
int usedSizeCol() const { return _diskUsageList->usedSizeCol(); }
int freeSizeCol() const { return _diskUsageList->freeSizeCol(); }
int totalSizeCol() const { return _diskUsageList->totalSizeCol(); }
@@ -234,13 +231,11 @@
*
* Stolen from KDirStat::KDirTreeView with the author's permission.
**/
- void paintPercentageBar( float percent,
- QPainter * painter,
+ void paintPercentageBar( QPainter * painter,
QStyleOptionViewItem option,
- const QColor & fillColor,
- const QColor & barBackground );
+ const QColor & fillColor);
- protected:
+protected:
//
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/QY2ListView.cc new/yast2-qt-2.16.12/src/QY2ListView.cc
--- old/yast2-qt-2.16.12/src/QY2ListView.cc 2007-12-21 18:41:52.000000000 +0100
+++ new/yast2-qt-2.16.12/src/QY2ListView.cc 2007-12-29 14:26:17.000000000 +0100
@@ -367,7 +367,7 @@
bool
QY2ListViewItem::operator< ( const QTreeWidgetItem & otherListViewItem ) const
{
- bool sortByInsertionSequence = false;
+ bool sortByInsertionSequence = false;
QY2ListView * parentListView = dynamic_cast<QY2ListView *> (treeWidget());
if ( parentListView )
@@ -429,6 +429,9 @@
_serial = 0;
QY2ListView * parentListView = dynamic_cast<QY2ListView *> ( treeWidget() );
+ setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
+ setCheckState(0, Qt::Unchecked);
+
if ( parentListView )
_serial = parentListView->nextSerial();
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/YQComboBox.cc new/yast2-qt-2.16.12/src/YQComboBox.cc
--- old/yast2-qt-2.16.12/src/YQComboBox.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/YQComboBox.cc 2007-12-29 14:26:17.000000000 +0100
@@ -95,7 +95,6 @@
{
YQSignalBlocker sigBlocker( _qt_comboBox );
int index = _qt_comboBox->findText( text );
- YItem *item = findItem( newValue );
if ( index < 0 )
_qt_comboBox->setItemText(_qt_comboBox->currentIndex(), text );
else {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-qt-2.16.12/src/YQRichText.cc new/yast2-qt-2.16.12/src/YQRichText.cc
--- old/yast2-qt-2.16.12/src/YQRichText.cc 2007-12-21 18:41:53.000000000 +0100
+++ new/yast2-qt-2.16.12/src/YQRichText.cc 2007-12-29 14:26:17.000000000 +0100
@@ -49,6 +49,7 @@
layout->addWidget( _textBrowser );
_textBrowser->installEventFilter( this );
+ _textBrowser->setFrameShape( QFrame::NoFrame );
if ( plainTextMode )
{
@@ -69,7 +70,7 @@
QPalette pal( _textBrowser->palette() );
pal.setColor( QPalette::Text, Qt::black );
- pal.setCurrentColorGroup( QPalette::Normal );
+ pal.setColor( QPalette::Base, QColor(0,0,0,0));
_textBrowser->setPalette( pal );
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-commit+help(a)opensuse.org