7 KMessagesWindow::KMessagesWindow( intf_thread_t * p_intf, msg_subscription_t *p_msg ) :
8 KDialogBase( Plain, _( "Messages" ), Ok, Ok, 0, 0, false)
11 // setWFlags(WType_TopLevel);
12 setSizeGripEnabled(true);
13 this->p_intf = p_intf;
15 QFrame *page = plainPage();
16 QVBoxLayout *toplayout = new QVBoxLayout( page);
17 // QScrollView *sv = new QScrollView(page);
18 // sv->setResizePolicy(QScrollView::AutoOneFit);
19 // sv->setFrameStyle(QScrollView::NoFrame);
20 // toplayout->addWidget(sv);
21 // QVBox *category_table = new QVBox(sv->viewport());
22 // sv->addChild(category_table);
23 // toplayout->addStretch(10);
24 QVBox *category_table = new QVBox(page);
25 toplayout->addWidget(category_table);
26 toplayout->setResizeMode(QLayout::FreeResize);
27 category_table->setSpacing(spacingHint());
29 new QLabel( _("Messages:"), category_table );
30 text = new QTextView( category_table );
31 // clearWFlags(WStyle_DialogBorder|WStyle_NoBorder);
32 // setWFlags(WStyle_NormalBorder|WStyle_Customize);
33 // connect(this, SIGNAL(okClicked()), this, SLOT(accept()));
36 KMessagesWindow::~KMessagesWindow()
41 void KMessagesWindow::update()
44 /* Update the log window */
45 vlc_mutex_lock( p_msg->p_lock );
46 i_stop = *p_msg->pi_stop;
47 vlc_mutex_unlock( p_msg->p_lock );
49 if( p_msg->i_start != i_stop )
51 // static GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
52 // static GdkColor gray = { 0, 0xaaaa, 0xaaaa, 0xaaaa };
53 // static GdkColor yellow = { 0, 0xffff, 0xffff, 0x6666 };
54 // static GdkColor red = { 0, 0xffff, 0x6666, 0x6666 };
56 static const char * ppsz_type[4] = { ": ", " error: ", " warning: ",
58 // static GdkColor * pp_color[4] = { &white, &red, &yellow, &gray };
60 for( i_start = p_msg->i_start;
62 i_start = (i_start+1) % VLC_MSG_QSIZE )
64 text->append( QString(p_msg->p_msg[i_start].psz_module) +
65 ppsz_type[p_msg->p_msg[i_start].i_type] +
66 p_msg->p_msg[i_start].psz_msg + "<br>");
68 // /* Append all messages to log window */
69 // gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, &gray,
70 // NULL, p_msg->p_msg[i_start].psz_module, -1 );
72 // gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, &gray,
73 // NULL, ppsz_type[p_msg->p_msg[i_start].i_type],
76 // gtk_text_insert( p_intf->p_sys->p_messages_text, NULL,
77 // pp_color[p_msg->p_msg[i_start].i_type], NULL,
78 // p_msg->p_msg[i_start].psz_msg, -1 );
80 // gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, &gray,
84 vlc_mutex_lock( p_msg->p_lock );
85 p_msg->i_start = i_start;
86 vlc_mutex_unlock( p_msg->p_lock );
87 // gtk_text_set_point( p_intf->p_sys->p_messages_text,
88 // gtk_text_get_length( p_intf->p_sys->p_messages_text ) );