2006-03-31 15:14:47 +00:00
/***************************************************************************
* Copyright ( C ) 2006 by Pino Toscano < toscano . pino @ tiscali . it > *
* *
* 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 . *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2007-04-19 18:30:20 +00:00
# include "dlgperformance.h"
2016-07-16 22:56:11 +00:00
# include <QButtonGroup>
# include <QFont>
2006-03-31 17:55:18 +00:00
2016-07-16 22:56:11 +00:00
# include <KConfigDialogManager>
# include "settings_core.h"
2006-04-10 19:50:00 +00:00
# include "ui_dlgperformancebase.h"
2006-03-31 15:14:47 +00:00
DlgPerformance : : DlgPerformance ( QWidget * parent )
: QWidget ( parent )
{
m_dlg = new Ui_DlgPerformanceBase ( ) ;
m_dlg - > setupUi ( this ) ;
2006-03-31 17:55:18 +00:00
QFont labelFont = m_dlg - > descLabel - > font ( ) ;
labelFont . setBold ( true ) ;
m_dlg - > descLabel - > setFont ( labelFont ) ;
2019-11-26 17:56:46 +00:00
m_dlg - > cpuLabel - > setPixmap ( QIcon : : fromTheme ( QStringLiteral ( " cpu " ) ) . pixmap ( 32 ) ) ;
// m_dlg->memoryLabel->setPixmap( QIcon::fromTheme( "kcmmemory" ).pixmap( 32 ) ); // TODO: enable again when proper icon is available
2016-07-16 22:56:11 +00:00
m_dlg - > memoryLevelGroup - > setId ( m_dlg - > lowRadio , 0 ) ;
m_dlg - > memoryLevelGroup - > setId ( m_dlg - > normalRadio , 1 ) ;
m_dlg - > memoryLevelGroup - > setId ( m_dlg - > aggressiveRadio , 2 ) ;
m_dlg - > memoryLevelGroup - > setId ( m_dlg - > greedyRadio , 3 ) ;
connect ( m_dlg - > memoryLevelGroup , static_cast < void ( QButtonGroup : : * ) ( int ) > ( & QButtonGroup : : buttonClicked ) , this , & DlgPerformance : : radioGroup_changed ) ;
2006-03-31 15:14:47 +00:00
}
2007-06-08 22:29:07 +00:00
DlgPerformance : : ~ DlgPerformance ( )
{
delete m_dlg ;
}
2006-06-19 14:55:03 +00:00
void DlgPerformance : : radioGroup_changed ( int which )
2006-03-31 15:14:47 +00:00
{
2006-06-19 14:55:03 +00:00
switch ( which ) {
case 0 :
m_dlg - > descLabel - > setText ( i18n ( " Keeps used memory as low as possible. Do not reuse anything. (For systems with low memory.) " ) ) ;
break ;
case 1 :
2015-07-09 22:06:11 +00:00
m_dlg - > descLabel - > setText ( i18n ( " A good compromise between memory usage and speed gain. Preload next page and boost searches. (For systems with 2GB of memory, typically.) " ) ) ;
2006-06-19 14:55:03 +00:00
break ;
case 2 :
2015-07-09 22:06:11 +00:00
m_dlg - > descLabel - > setText ( i18n ( " Keeps everything in memory. Preload next pages. Boost searches. (For systems with more than 4GB of memory.) " ) ) ;
2006-06-19 14:55:03 +00:00
break ;
2012-03-08 23:12:20 +00:00
case 3 :
2012-03-09 09:33:54 +00:00
// xgettext: no-c-format
2012-03-08 23:12:20 +00:00
m_dlg - > descLabel - > setText ( i18n ( " Loads and keeps everything in memory. Preload all pages. (Will use at maximum 50% of your total memory or your free memory, whatever is bigger.) " ) ) ;
break ;
2006-06-19 14:55:03 +00:00
}
2006-03-31 15:14:47 +00:00
}
2014-08-08 22:00:07 +00:00
# include "moc_dlgperformance.cpp"