[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: extragear/multimedia/amarok/src/engine/nmm
From: Robert Gogolok <robertgogolok () gmx ! de>
Date: 2006-03-05 11:27:15
Message-ID: 1141558035.318861.8547.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 515911 by gogolok:
fill status column
M +31 -16 HostListItem.cpp
M +1 -0 HostListItem.h
M +1 -1 nmm_configdialogbase.ui
--- trunk/extragear/multimedia/amarok/src/engine/nmm/HostListItem.cpp #515910:515911
@@ -24,28 +24,27 @@
#include "HostListItem.h"
-#include <qapplication.h>
+#include <qfont.h>
#include <qheader.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qslider.h>
-#include <qwhatsthis.h>
+#include <qpainter.h>
-#include <kconfig.h>
-#include <kdebug.h>
#include <kglobal.h>
#include <kiconloader.h>
#include "debug.h"
#include "HostList.h"
-HostListItem::HostListItem( QListView *parent, QString hostname, bool audio, bool \
video, int volume, bool read_only ) +HostListItem::HostListItem( QListView *parent, \
QString hostname, bool audio, bool video, int , bool read_only ) : KListViewItem( \
parent ), m_audio( audio ),
m_video( video ),
- m_read_only( read_only )
+ m_read_only( read_only ),
+ m_status_error( false )
{
setText( HostListItem::Hostname, hostname);
+
+ setPixmap( HostListItem::Status, SmallIcon("help") );
+ setText( HostListItem::Status, "OK" );
}
HostListItem::~HostListItem()
@@ -65,20 +64,36 @@
void HostListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int \
width, int align ) {
- if( column == 1 )
+ QColorGroup m_cg( cg );
+
+ if( column == HostListItem::Video )
{
if( m_video )
- setPixmap( 1, SmallIcon("nmm_option_on") );
+ setPixmap( HostListItem::Video, SmallIcon("nmm_option_on") );
else
- setPixmap( 1, SmallIcon("nmm_option_off") );
+ setPixmap( HostListItem::Video, SmallIcon("nmm_option_off") );
}
- if( column == 2 )
+ else if( column == HostListItem::Audio )
{
if( m_audio )
- setPixmap( 2, SmallIcon("nmm_option_on") );
+ setPixmap( HostListItem::Audio, SmallIcon("nmm_option_on") );
else
- setPixmap( 2, SmallIcon("nmm_option_off") );
+ setPixmap( HostListItem::Audio, SmallIcon("nmm_option_off") );
}
+ else if( column == HostListItem::Status )
+ {
+ QFont font( p->font() );
+ if( m_status_error )
+ {
+ font.setBold( true );
+ m_cg.setColor( QColorGroup::Text, Qt::red );
+ }
+ else {
+ font.setBold( false );
+ m_cg.setColor( QColorGroup::Text, Qt::darkGreen );
+ }
+ p->setFont( font );
+ }
- KListViewItem::paintCell(p, cg, column, width, align);
+ KListViewItem::paintCell(p, m_cg, column, width, align);
}
--- trunk/extragear/multimedia/amarok/src/engine/nmm/HostListItem.h #515910:515911
@@ -57,6 +57,7 @@
bool m_audio;
bool m_video;
bool m_read_only;
+ bool m_status_error;
};
#endif
--- trunk/extragear/multimedia/amarok/src/engine/nmm/nmm_configdialogbase.ui \
#515910:515911 @@ -80,7 +80,7 @@
<cstring>audioGroup</cstring>
</property>
<property name="title">
- <string>Audio,Video Location</string>
+ <string>Video,Audio Location</string>
</property>
<vbox>
<property name="name">
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic