]> git.sesse.net Git - vlc/blobdiff - modules/gui/kde/messages.cpp
Improvements to preferences
[vlc] / modules / gui / kde / messages.cpp
index caa8329fa36a3e3d23ddbb3ca072e8a8446fa475..38894efd245dd95796fabefcb901e175c94b28d6 100644 (file)
@@ -1,3 +1,26 @@
+/*****************************************************************************
+ * messages.cpp: the KMessagesWindow class
+ *****************************************************************************
+ * Copyright (C) 2001-2003 VideoLAN
+ * $Id: messages.cpp,v 1.5 2003/12/22 14:23:14 sam Exp $
+ *
+ * Author: Sigmund Augdal <sigmunau@idi.ntnu.no>
+ *
+ * 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 program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
 #include "messages.h"
 #include <qtextview.h>
 #include <qlayout.h>
@@ -28,6 +51,7 @@ KMessagesWindow::KMessagesWindow( intf_thread_t * p_intf,  msg_subscription_t *p
     resize(300,400);
     new QLabel( _("Messages:"), category_table );
     text = new QTextView( category_table );
+    text->setPaper( QBrush( black ) );
 //    clearWFlags(WStyle_DialogBorder|WStyle_NoBorder);
 //    setWFlags(WStyle_NormalBorder|WStyle_Customize);
 //    connect(this, SIGNAL(okClicked()), this, SLOT(accept()));
@@ -48,44 +72,29 @@ void KMessagesWindow::update()
 
     if( p_msg->i_start != i_stop )
     {
-//         static GdkColor white  = { 0, 0xffff, 0xffff, 0xffff };
-//         static GdkColor gray   = { 0, 0xaaaa, 0xaaaa, 0xaaaa };
-//         static GdkColor yellow = { 0, 0xffff, 0xffff, 0x6666 };
-//         static GdkColor red    = { 0, 0xffff, 0x6666, 0x6666 };
-        
         static const char * ppsz_type[4] = { ": ", " error: ", " warning: ",
                                              " debug: " };
-//        static GdkColor *   pp_color[4] = { &white, &red, &yellow, &gray };
-
+        static const char * ppsz_color[4] = {
+            "<font color=white>",
+            "<font color=red>",
+            "<font color=yellow>",
+            "<font color=gray>"
+        };
         for( i_start = p_msg->i_start;
              i_start != i_stop;
              i_start = (i_start+1) % VLC_MSG_QSIZE )
         {
-            text->append( QString(p_msg->p_msg[i_start].psz_module) +
+            text->append( QString("<font color=white>") +
+                          p_msg->p_msg[i_start].psz_module +
                           ppsz_type[p_msg->p_msg[i_start].i_type] +
-                          p_msg->p_msg[i_start].psz_msg + "<br>");
-            
-//             /* Append all messages to log window */
-//             gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, &gray,
-//              NULL, p_msg->p_msg[i_start].psz_module, -1 );
-
-//             gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, &gray,
-//                 NULL, ppsz_type[p_msg->p_msg[i_start].i_type],
-//                 -1 );
-
-//             gtk_text_insert( p_intf->p_sys->p_messages_text, NULL,
-//                 pp_color[p_msg->p_msg[i_start].i_type], NULL,
-//                 p_msg->p_msg[i_start].psz_msg, -1 );
-
-//             gtk_text_insert( p_intf->p_sys->p_messages_text, NULL, &gray,
-//                 NULL, "\n", -1 );
+                          "</font>" +
+                          ppsz_color[p_msg->p_msg[i_start].i_type] +
+                          p_msg->p_msg[i_start].psz_msg + "</font>" );
         }
 
         vlc_mutex_lock( p_msg->p_lock );
         p_msg->i_start = i_start;
         vlc_mutex_unlock( p_msg->p_lock );
-//        gtk_text_set_point( p_intf->p_sys->p_messages_text,
-//                    gtk_text_get_length( p_intf->p_sys->p_messages_text ) );
 
     }
 }