commit yast2-control-center for openSUSE:11.4
Hello community, here is the log from the commit of package yast2-control-center for openSUSE:11.4 checked in at Wed Mar 23 01:11:38 CET 2011. -------- --- old-versions/11.4/all/yast2-control-center/yast2-control-center.changes 2010-10-11 11:19:47.000000000 +0200 +++ 11.4/yast2-control-center/yast2-control-center.changes 2011-02-23 13:08:08.000000000 +0100 @@ -1,0 +2,18 @@ +Wed Feb 23 13:06:01 CET 2011 - tgoettlicher@suse.de + +- remember panel width (bnc #613352) +- 2.20.2 + +------------------------------------------------------------------- +Tue Feb 22 17:36:58 CET 2011 - tgoettlicher@suse.de + +- fixed bnc #650907: yast2 shrinks module selector item on search +- 2.20.1 + +------------------------------------------------------------------- +Tue Feb 22 14:20:36 CET 2011 - tgoettlicher@suse.de + +- bnc #661109: Layout of icons gets mixed after using search +- 2.20.0 + +------------------------------------------------------------------- Package does not exist at destination yet. Using Fallback old-versions/11.4/all/yast2-control-center Destination is old-versions/11.4/UPDATES/all/yast2-control-center calling whatdependson for 11.4-i586 Old: ---- yast2-control-center-2.19.3.tar.bz2 New: ---- yast2-control-center-2.20.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-control-center.spec ++++++ --- /var/tmp/diff_new_pack.drfjiG/_old 2011-03-23 01:11:20.000000000 +0100 +++ /var/tmp/diff_new_pack.drfjiG/_new 2011-03-23 01:11:20.000000000 +0100 @@ -1,7 +1,7 @@ # -# spec file for package yast2-control-center (Version 2.19.3) +# spec file for package yast2-control-center # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,11 +18,11 @@ Name: yast2-control-center -Version: 2.19.3 -Release: 1 +Version: 2.20.2 +Release: 1.<RELEASE2> BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-control-center-2.19.3.tar.bz2 +Source0: yast2-control-center-2.20.2.tar.bz2 Group: System/YaST License: GPLv2+ BuildRequires: libdrm-devel libjpeg-devel libqt4-devel pkgconfig update-desktop-files yast2-devtools ++++++ yast2-control-center-2.19.3.tar.bz2 -> yast2-control-center-2.20.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/VERSION.cmake new/yast2-control-center-2.20.2/VERSION.cmake --- old/yast2-control-center-2.19.3/VERSION.cmake 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/VERSION.cmake 2011-03-18 10:47:14.000000000 +0100 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "2") -SET(VERSION_MINOR "19") -SET(VERSION_PATCH "3") +SET(VERSION_MINOR "20") +SET(VERSION_PATCH "2") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/package/yast2-control-center.changes new/yast2-control-center-2.20.2/package/yast2-control-center.changes --- old/yast2-control-center-2.19.3/package/yast2-control-center.changes 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/package/yast2-control-center.changes 2011-03-18 10:47:14.000000000 +0100 @@ -1,4 +1,22 @@ ------------------------------------------------------------------- +Wed Feb 23 13:06:01 CET 2011 - tgoettlicher@suse.de + +- remember panel width (bnc #613352) +- 2.20.2 + +------------------------------------------------------------------- +Tue Feb 22 17:36:58 CET 2011 - tgoettlicher@suse.de + +- fixed bnc #650907: yast2 shrinks module selector item on search +- 2.20.1 + +------------------------------------------------------------------- +Tue Feb 22 14:20:36 CET 2011 - tgoettlicher@suse.de + +- bnc #661109: Layout of icons gets mixed after using search +- 2.20.0 + +------------------------------------------------------------------- Mon Oct 11 11:17:55 CEST 2010 - tgoettlicher@suse.de - Adapted license format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/CMakeLists.txt new/yast2-control-center-2.20.2/src/CMakeLists.txt --- old/yast2-control-center-2.19.3/src/CMakeLists.txt 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/CMakeLists.txt 2011-03-18 10:47:14.000000000 +0100 @@ -17,22 +17,15 @@ main.cpp main_window.cpp kcategorizedview.cpp - # menuitem.cpp kcategorydrawer.cpp kcategorizedsortfilterproxymodel.cpp - # kcmodulemodel.cpp moduleiconitem.cpp - # kcmoduleinfo.cpp - yccmoduleinfoprovider.cpp - yqdesktopfilesmodel.cpp yqmodulegroupsmodel.cpp yqmodulesmodel.cpp yqmodulesproxymodel.cpp - yqsavelogs.cpp - i18n.cpp ) @@ -43,23 +36,17 @@ SET(yast2-control-center_HDRS main_window.h kcategorizedview.h - # menuitem.h - # kcmodulemodel.h kcategorydrawer.h kcategorizedsortfilterproxymodel.h moduleiconitem.h - # kcmoduleinfo.h kcategorizedview_p.h - yccmoduleinfoprovider.h - yqdesktopfilesmodel.h yqmodulegroupsmodel.h yqmodulesmodel.h yqmodulesproxymodel.h - + listview.h yqsavelogs.h - i18n.h ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/kcategorizedsortfilterproxymodel.cpp new/yast2-control-center-2.20.2/src/kcategorizedsortfilterproxymodel.cpp --- old/yast2-control-center-2.19.3/src/kcategorizedsortfilterproxymodel.cpp 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/kcategorizedsortfilterproxymodel.cpp 2011-03-18 10:47:14.000000000 +0100 @@ -323,11 +323,13 @@ return ( nameMatches || keywordMatches ); } -void KCategorizedSortFilterProxyModel::bublisFilterFunction( const QString &s ) +void KCategorizedSortFilterProxyModel::customFilterFunction( const QString &s ) { d->filterGroups.clear(); setFilterFixedString( s ); d->filterString = s; + invalidateFilter(); + invalidate(); } QString KCategorizedSortFilterProxyModel::matchingGroupFilterRegexp() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/kcategorizedsortfilterproxymodel.h new/yast2-control-center-2.20.2/src/kcategorizedsortfilterproxymodel.h --- old/yast2-control-center-2.19.3/src/kcategorizedsortfilterproxymodel.h 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/kcategorizedsortfilterproxymodel.h 2011-03-18 10:47:14.000000000 +0100 @@ -116,7 +116,7 @@ */ static int naturalCompare(const QString &a, const QString &b); - void bublisFilterFunction( const QString &s ); + void customFilterFunction( const QString &s ); QString matchingGroupFilterRegexp(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/kcategorizedview.cpp new/yast2-control-center-2.20.2/src/kcategorizedview.cpp --- old/yast2-control-center-2.19.3/src/kcategorizedview.cpp 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/kcategorizedview.cpp 2011-03-18 10:47:14.000000000 +0100 @@ -27,6 +27,7 @@ #include <QScrollBar> #include <QPaintEvent> #include <QDebug> +#include <iostream> #include "kcategorydrawer.h" @@ -174,10 +175,12 @@ int itemWidthPlusSeparation = listView->spacing() + itemWidth; if (!itemWidthPlusSeparation) itemWidthPlusSeparation++; + int elementsPerRow = viewportWidth / itemWidthPlusSeparation; if (!elementsPerRow) elementsPerRow++; + int column; int row; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/kde/CMakeLists.txt new/yast2-control-center-2.20.2/src/kde/CMakeLists.txt --- old/yast2-control-center-2.19.3/src/kde/CMakeLists.txt 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/kde/CMakeLists.txt 2011-03-18 10:47:14.000000000 +0100 @@ -10,4 +10,4 @@ ########### install files ############### install( FILES kcmyast.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES emoticons.knsrc DESTINATION ${CONFIG_INSTALL_DIR} ) +#install( FILES emoticons.knsrc DESTINATION ${CONFIG_INSTALL_DIR} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/kde/kcmyast.desktop new/yast2-control-center-2.20.2/src/kde/kcmyast.desktop --- old/yast2-control-center-2.19.3/src/kde/kcmyast.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-control-center-2.20.2/src/kde/kcmyast.desktop 2011-03-18 10:47:14.000000000 +0100 @@ -0,0 +1,13 @@ +[Desktop Entry] +Exec=kcmshell4 kcm_yast +Icon=yast +Type=Service +X-DocPath=kcontrol/emoticons/index.html + +X-KDE-ServiceTypes=KCModule,KCModuleInit +X-KDE-Library=kcm_yast +X-KDE-ParentApp=kcontrol +X-KDE-System-Settings-Parent-Category=computer-administration +X-KDE-Weight=110 + +Name=Advanced Administration (YaST) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/kde/kcmyast.destop new/yast2-control-center-2.20.2/src/kde/kcmyast.destop --- old/yast2-control-center-2.19.3/src/kde/kcmyast.destop 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/kde/kcmyast.destop 1970-01-01 01:00:00.000000000 +0100 @@ -1,13 +0,0 @@ -[Desktop Entry] -Exec=kcmshell4 kcm_yast -Icon=yast -Type=Service -X-DocPath=kcontrol/emoticons/index.html - -X-KDE-ServiceTypes=KCModule,KCModuleInit -X-KDE-Library=kcm_yast -X-KDE-ParentApp=kcontrol -X-KDE-System-Settings-Parent-Category=computer-administration -X-KDE-Weight=110 - -Name=Advanced Administration (YaST) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/listview.h new/yast2-control-center-2.20.2/src/listview.h --- old/yast2-control-center-2.19.3/src/listview.h 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-control-center-2.20.2/src/listview.h 2011-03-18 10:47:14.000000000 +0100 @@ -0,0 +1,13 @@ +#include <QtGui> + +class ListView : public QListView +{ +public: + ListView() : QListView() { mySize = QSize(42,42); } + + QSize sizeHint() const { return mySize; } + void setSizeHint( QSize s ) { mySize = s; } + +private: + QSize mySize; +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/main_window.cpp new/yast2-control-center-2.20.2/src/main_window.cpp --- old/yast2-control-center-2.19.3/src/main_window.cpp 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/main_window.cpp 2011-03-18 10:47:14.000000000 +0100 @@ -38,12 +38,15 @@ #include "yqmodulesmodel.h" #include "yqmodulegroupsmodel.h" +#include "listview.h" //#include "moduleiconitem.h" #define ORG_NAME "YaST2" #define APP_NAME "y2controlcenter-qt" #define USED_QUEUE_SIZE 5 +#define GROUPSIZE QSize(200,350) + /* Textdomain "control-center" @@ -67,7 +70,7 @@ } YQModulesModel *modmodel; - QListView *groupview; + ListView *groupview; KCategorizedView * modview; // category proxy model KCategorizedSortFilterProxyModel * kcsfpm; @@ -144,9 +147,11 @@ d->gcsfpm->setFilterKeyColumn( 2 ); d->gcsfpm->setFilterRole( Qt::UserRole ); - d->groupview = new QListView( ); + d->groupview = new ListView( ); + d->groupview->setModel(d->gcsfpm); d->groupview->setIconSize( QSize(32,32) ); + d->groupview->setSizeHint( readGroupViewSize() ); //now pre-select something d->groupview->setSelectionMode( QAbstractItemView::SingleSelection ); @@ -192,6 +197,8 @@ connect( logSaver, SIGNAL( statusMsg( const QString &)), statusBar(), SLOT( showMessage( const QString &) )); + +// d->groupview->setSizeHint(500,500); } void MainWindow::setFullScreen( bool fs ) @@ -309,7 +316,7 @@ void MainWindow::slotFilterChanged() { QString stext = d->searchField->text(); - d->kcsfpm->bublisFilterFunction( stext ); + d->kcsfpm->customFilterFunction( stext ); QString gr_filter = d->kcsfpm->matchingGroupFilterRegexp(); d->gcsfpm->setFilterRegExp ( gr_filter ); @@ -348,6 +355,19 @@ } +QSize MainWindow::readGroupViewSize() +{ + QSettings settings(ORG_NAME, APP_NAME); + QSize size; + + settings.beginGroup("GroupView"); + size = settings.value("Size", GROUPSIZE).toSize(); + settings.endGroup(); + + return size; +} + + void MainWindow::writeSettings() { QSettings settings(ORG_NAME, APP_NAME); @@ -361,6 +381,11 @@ QStringList used_list( d->recentlyUsed ); settings.setValue( "RecentlyUsed", used_list.join(",") ); settings.endGroup(); + + settings.beginGroup("GroupView"); + settings.setValue("Size", d->groupview->size()); + settings.endGroup(); + } void MainWindow::setWinTitle() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/main_window.h new/yast2-control-center-2.20.2/src/main_window.h --- old/yast2-control-center-2.19.3/src/main_window.h 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/main_window.h 2011-03-18 10:47:14.000000000 +0100 @@ -62,6 +62,9 @@ void writeSettings(); void readSettings(); void setWinTitle(); + QSize readGroupViewSize(); + + QDockWidget *groupdock; }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/moduleiconitem.cpp new/yast2-control-center-2.20.2/src/moduleiconitem.cpp --- old/yast2-control-center-2.19.3/src/moduleiconitem.cpp 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/moduleiconitem.cpp 2011-03-18 10:47:14.000000000 +0100 @@ -20,8 +20,6 @@ */ #include "moduleiconitem.h" -//#include <kiconloader.h> -//#include <kdebug.h> #include "kcmoduleinfo.h" #include <climits> @@ -88,9 +86,6 @@ } painter->setFont( f ); -// if( index.data( Qt::UserRole ).toInt() == KIconLoader::DisabledState ) { -// painter->setPen( option.palette.color( QPalette::Disabled, QPalette::Text ) ); -// } QIcon::Mode iconMode = QIcon::Normal; if (selected) iconMode = QIcon::Selected; @@ -114,8 +109,8 @@ QFontMetrics fm( f ); QSize s = QItemDelegate::sizeHint( option, index ); - int w = lviewstyle->pixelMetric( QStyle::PM_FocusFrameHMargin ) + 2*lviewstyle->pixelMetric( QStyle::PM_ListViewIconSize ) + - + fm.boundingRect( text ).width(); + int w = 2*lviewstyle->pixelMetric( QStyle::PM_FocusFrameHMargin ) + 2*lviewstyle->pixelMetric( QStyle::PM_ListViewIconSize ) + 8 + fm.boundingRect( text ).width(); + return QSize( w, s.height()); } @@ -137,42 +132,4 @@ return path; } -/*ModuleIconItem::ModuleIconItem( QListWidget* parent, const KCModuleInfo& module) - :// QListWidgetItem(SmallIcon( module.icon(), IMAGE_SIZE ), module.moduleName(), parent), - imageName(module.icon()) -{ - - std::cout << "ModuleIconItem::ModuleIconItem" << std::endl; -// setData( Qt::UserRole, KIconLoader::DefaultState ); - modules.append(module); - setSize(); -} - -ModuleIconItem::ModuleIconItem( QListWidget* parent, const QString &text, - const QString &_imageName ) - : //QListWidgetItem( SmallIcon( _imageName, IMAGE_SIZE ), text, parent ), - imageName(_imageName) -{ - std::cout << "ModuleIconItem::ModuleIconItem" << std::endl; -// setData( Qt::UserRole, KIconLoader::DefaultState ); - setSize(); -} - -void ModuleIconItem::loadIcon( bool enabled ) -{ - std::cout << "ModuleIconItem::loadIcon" << std::endl; -// int newState = enabled ? KIconLoader::DefaultState : KIconLoader::DisabledState; -// if( newState == data( Qt::UserRole ).toInt() ) - return; - -// setData( Qt::UserRole, newState ); -// setIcon( DesktopIcon( imageName, IMAGE_SIZE , newState ) ); -} -void ModuleIconItem::setSize() -{ - QStyle *style = listWidget()->style(); - QFontMetrics fm(font()); - const QRect &rect = fm.boundingRect(0, 0, ICON_WIDTH, INT_MAX, Qt::TextWordWrap, text()); - setData(Qt::SizeHintRole, QSize(ICON_WIDTH, IMAGE_SIZE + style->pixelMetric(QStyle::PM_FocusFrameVMargin) + rect.height())); -}*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/modulesview.cpp new/yast2-control-center-2.20.2/src/modulesview.cpp --- old/yast2-control-center-2.19.3/src/modulesview.cpp 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/modulesview.cpp 1970-01-01 01:00:00.000000000 +0100 @@ -1,187 +0,0 @@ -/** - * This file is part of the System Settings package - * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot net) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "modulesview.h" - -#include <qlabel.h> -#include <QListWidget> -#include <qlayout.h> -#include <QApplication> - -#include "kcmsearch.h" -#include "moduleiconitem.h" -#include "kcmodulemenu.h" -#include <iostream> - - -ModulesView::ModulesView( KCModuleMenu *rootMenu, const QString &menuPath, QWidget *parent ) : QWidget( parent ), rootMenu( NULL ) -{ - this->rootMenu = rootMenu; - this->menuPath = menuPath; - this->categories = KServiceTypeTrader::self()->query("SystemSettingsCategory"); - - QVBoxLayout *layout = new QVBoxLayout( this ); - layout->setMargin( KDialog::marginHint() ); - layout->setSpacing( KDialog::spacingHint() ); - layout->setObjectName( QLatin1String( "layout" ) ); - - displayName = this->rootMenu->caption; - - QList<MenuItem> subMenus = rootMenu->menuList(menuPath); - QList<MenuItem>::const_iterator it; - for ( it = subMenus.begin(); it != subMenus.end(); ++it ){ - if( !(*it).menu ) - continue; - - // After the first time around add a line - if( it != subMenus.begin() ){ - QFrame *line = new QFrame( this ); - line->setObjectName( QLatin1String( "line" ) ); - line->setFrameShadow( QFrame::Sunken ); - line->setFrameShape( QFrame::HLine ); - layout->addWidget( line ); - } - - // Build the row of modules/icons - createRow( (*it).subMenu, layout ); - } - layout->addStretch(1); - - setBackgroundRole(QPalette::Base); - setForegroundRole(QPalette::Text); - - /* - // Align them up! - uint most = 0; - QList<RowIconView*>::iterator it2; - for ( it2 = groups.begin(); it2 != groups.end(); ++it2 ){ - for (int i = 0; i < (*it2)->count(); ++i ) { - QListWidgetItem * item = (*it2)->item( i ); - if ( item && item->sizeHint().width() > most ) { - most = item->sizeHint().width(); - } - } - } -*/ -/*FIXME - for ( it = groups.begin(); it != groups.end(); ++it ) - (*it)->setGridX(most); - - } -*/ -} - -ModulesView::~ModulesView() -{ -} - -void ModulesView::createRow( const QString &parentPath, QBoxLayout *boxLayout ) -{ - //find the category name and search for it - QString categoryName = parentPath.section('/', -2, -2); - QString iconName; - for (int i = 0; i < categories.size(); ++i) { - const KService* entry = categories.at(i).data(); - if (entry->name() == categoryName) { - iconName = entry->icon(); - break; - } - } - - // Make header - QHBoxLayout *rowLayout = new QHBoxLayout(); - rowLayout->setMargin( 0 ); - rowLayout->setSpacing( 6 ); - rowLayout->setObjectName( QLatin1String( "rowLayout" ) ); - - // Header Icon - QLabel *icon = new QLabel( this ); - icon->setObjectName( QLatin1String( "groupicon" ) ); - icon->setPixmap( SmallIcon( iconName )); - QSizePolicy sp( QSizePolicy::Minimum, QSizePolicy::Preferred ); - sp.setHeightForWidth( icon->sizePolicy().hasHeightForWidth() ); - icon->setSizePolicy( sp ); - rowLayout->addWidget( icon ); - - // Header Name - QLabel *textLabel = new QLabel( this ); - textLabel->setObjectName( QLatin1String( "groupcaption" ) ); - textLabel->setText( categoryName ); - QSizePolicy sp1( QSizePolicy::Expanding, QSizePolicy::Preferred ); - sp1.setHeightForWidth( textLabel->sizePolicy().hasHeightForWidth() ); - textLabel->setSizePolicy( sp1 ); - QFont textLabel_font( textLabel->font() ); - textLabel_font.setBold( true ); - textLabel->setFont( textLabel_font ); - rowLayout->addWidget( textLabel ); - - boxLayout->addLayout( rowLayout ); - - // Make IconView - RowIconView* iconWidget = new RowIconView( this ); - connect(iconWidget, SIGNAL( itemClicked( QListWidgetItem* ) ), - this, SIGNAL( itemSelected( QListWidgetItem* ) ) ); - connect(iconWidget, SIGNAL( itemActivated( QListWidgetItem* ) ), - this, SIGNAL( itemSelected( QListWidgetItem* ) ) ); - groups.append( iconWidget ); - boxLayout->addWidget( iconWidget ); - - int height = 0; - // Add all the items in their proper order - QList<MenuItem> list = rootMenu->menuList( parentPath ); - QList<MenuItem>::const_iterator it; - for ( it = list.begin(); it != list.end(); ++it ){ - ModuleIconItem *item = NULL; - if( !(*it).menu ) { - item = new ModuleIconItem( iconWidget, (*it).item ); - } else { - QString path = (*it).subMenu; - - QString categoryCaption = (*it).caption; - QString iconFile; - for (int i = 0; i < categories.size(); ++i) { - const KService* entry = categories.at(i).data(); - if (entry->name() == categoryCaption) { - iconFile = entry->icon(); - break; - } - } - - const QList<KCModuleInfo> &modules = rootMenu->modules( path ); - if ( modules.count() > 0 ) { - item = new ModuleIconItem( iconWidget, categoryCaption, iconFile); - item->modules = modules; - } - } - if (item) height = qMax(height, item->data(Qt::SizeHintRole).toSize().height()); - } - - // give the proper height to make all the items visible - iconWidget->setMinimumHeight(height); -} - -void ModulesView::clearSelection() { - QList<RowIconView*>::const_iterator it; - for ( it = groups.begin(); it != groups.end(); ++it ) { - (*it)->clearSelection(); - } -} - -#include "modulesview.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-control-center-2.19.3/src/modulesview.h new/yast2-control-center-2.20.2/src/modulesview.h --- old/yast2-control-center-2.19.3/src/modulesview.h 2010-10-11 11:19:35.000000000 +0200 +++ new/yast2-control-center-2.20.2/src/modulesview.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,111 +0,0 @@ -/** - * This file is part of the System Preferences package - * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot net) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef MODULESVIEW_H -#define MODULESVIEW_H - -#include "moduleiconitem.h" - -#include <QListWidget> -#include <QList> - -/** - * Overloaded to give a larger default size that fits with text of two lines. - */ -class RowIconView : public QListWidget -{ - -public: - RowIconView( QWidget* parent ) : QListWidget( parent ) - { - setResizeMode(Adjust); - setViewMode(IconMode); - setMovement(Static); - setFrameShape(NoFrame); - setWordWrap(true); - setItemDelegate(new ModuleIconItemDelegate(this)); - } - - // Figure out the hight/width to have only one row - QSize minimumSizeHint() const { - int width = 0; - /* - for ( QIconViewItem *item = firstItem(); item; item = item->nextItem() ) - width += item->width(); - width += spacing()*(count())+(margin()+frameWidth()+lineWidth()+midLineWidth())*2 ; - */ - - //width = count()*gridX()+frameWidth()*2; - width = count()*gridSize().width()+frameWidth()*2; - - int height =48; -//FIXME for ( Q3IconViewItem *item = firstItem(); item; item = item->nextItem() ) -// if(item->height() > height) -// height = item->height(); - // I honestly don't know where the 4+4 is coming from... - // What other spacing did I miss? - height += (/*margin()+*/frameWidth()+spacing()+lineWidth()+midLineWidth())*2+8; - -/* - int h = fontMetrics().height(); - if ( h < 10 ) - h = 10; - int f = 2 * frameWidth(); - int height = ( 2*h ) + f + spacing() * 2 + 32 + lineWidth()*2 + 10; - */ - return QSize( width, height ); - } -}; - -class QBoxLayout; -class KCModuleMenu; - -/** - * This widget contains the IconView's of all of the modules etc - * It is the basic thing that users see. - */ -class ModulesView : public QWidget -{ - // To search the groups - friend class KcmSearch; - -Q_OBJECT -public: - void clearSelection(); - QString displayName; - -signals: - void itemSelected( QListWidgetItem* item ); - -public: - ModulesView( KCModuleMenu *rootMenu, const QString &menuPath, QWidget *parent=0 ); - ~ModulesView(); - -private: - QList<RowIconView*> groups; - KCModuleMenu *rootMenu; - QString menuPath; - KService::List categories; - - void createRow( const QString &parentPath, QBoxLayout *layout ); -}; - -#endif // MODULESVIEW_H - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de