kde.cpp: subscribe and unsubscribe messages

 interface.cpp, interface.h: create a messages window, and add menu iten to
show it
 Modules.as: build messages window
 ui.rc: menuitem to show messages
 preferences.cpp: fixed typo in comment
parent ad626cd2
...@@ -7,7 +7,8 @@ SOURCES_kde = \ ...@@ -7,7 +7,8 @@ SOURCES_kde = \
modules/gui/kde/menu.cpp \ modules/gui/kde/menu.cpp \
modules/gui/kde/preferences.cpp \ modules/gui/kde/preferences.cpp \
modules/gui/kde/pluginsbox.cpp \ modules/gui/kde/pluginsbox.cpp \
modules/gui/kde/QConfigItem.cpp modules/gui/kde/QConfigItem.cpp \
modules/gui/kde/messages.cpp
nodist_SOURCES_kde = \ nodist_SOURCES_kde = \
modules/gui/kde/interface.moc.cpp \ modules/gui/kde/interface.moc.cpp \
...@@ -17,7 +18,8 @@ nodist_SOURCES_kde = \ ...@@ -17,7 +18,8 @@ nodist_SOURCES_kde = \
modules/gui/kde/menu.moc.cpp \ modules/gui/kde/menu.moc.cpp \
modules/gui/kde/preferences.moc.cpp \ modules/gui/kde/preferences.moc.cpp \
modules/gui/kde/pluginsbox.moc.cpp \ modules/gui/kde/pluginsbox.moc.cpp \
modules/gui/kde/QConfigItem.moc.cpp modules/gui/kde/QConfigItem.moc.cpp \
modules/gui/kde/messages.moc.cpp
noinst_HEADERS += \ noinst_HEADERS += \
modules/gui/kde/common.h \ modules/gui/kde/common.h \
...@@ -28,7 +30,8 @@ noinst_HEADERS += \ ...@@ -28,7 +30,8 @@ noinst_HEADERS += \
modules/gui/kde/net.h \ modules/gui/kde/net.h \
modules/gui/kde/pluginsbox.h \ modules/gui/kde/pluginsbox.h \
modules/gui/kde/preferences.h \ modules/gui/kde/preferences.h \
modules/gui/kde/slider.h modules/gui/kde/slider.h \
modules/gui/kde/messages.h
modules/gui/kde/interface.moc.cpp: modules/gui/kde/interface.h modules/gui/kde/interface.moc.cpp: modules/gui/kde/interface.h
$(MOC) $< -o $@ $(MOC) $< -o $@
...@@ -46,5 +49,7 @@ modules/gui/kde/pluginsbox.moc.cpp: modules/gui/kde/pluginsbox.h ...@@ -46,5 +49,7 @@ modules/gui/kde/pluginsbox.moc.cpp: modules/gui/kde/pluginsbox.h
$(MOC) $< -o $@ $(MOC) $< -o $@
modules/gui/kde/QConfigItem.moc.cpp: modules/gui/kde/QConfigItem.h modules/gui/kde/QConfigItem.moc.cpp: modules/gui/kde/QConfigItem.h
$(MOC) $< -o $@ $(MOC) $< -o $@
modules/gui/kde/messages.moc.cpp: modules/gui/kde/messages.h
$(MOC) $< -o $@
EXTRA_DIST += modules/gui/kde/ui.rc EXTRA_DIST += modules/gui/kde/ui.rc
...@@ -37,7 +37,8 @@ KInterface::KInterface( intf_thread_t *p_intf, QWidget *parent, ...@@ -37,7 +37,8 @@ KInterface::KInterface( intf_thread_t *p_intf, QWidget *parent,
setAcceptDrops(true); setAcceptDrops(true);
this->p_intf = p_intf; this->p_intf = p_intf;
p_messagesWindow = new KMessagesWindow( p_intf, p_intf->p_sys->p_msg );
p_messagesWindow->show();
fDiskDialog = new KDiskDialog( this ); fDiskDialog = new KDiskDialog( this );
fNetDialog = new KNetDialog( this ); fNetDialog = new KNetDialog( this );
fTitleMenu = new KTitleMenu( p_intf, this ); fTitleMenu = new KTitleMenu( p_intf, this );
...@@ -98,6 +99,7 @@ void KInterface::initActions() ...@@ -98,6 +99,7 @@ void KInterface::initActions()
fast = new KAction( i18n( "Fas&t" ), 0, 0, this, SLOT( slotFast() ), actionCollection(), "fast" ); fast = new KAction( i18n( "Fas&t" ), 0, 0, this, SLOT( slotFast() ), actionCollection(), "fast" );
prev = new KAction( i18n( "Prev" ), 0, 0, this, SLOT( slotPrev() ), actionCollection(), "prev" ); prev = new KAction( i18n( "Prev" ), 0, 0, this, SLOT( slotPrev() ), actionCollection(), "prev" );
next = new KAction( i18n( "Next" ), 0, 0, this, SLOT( slotNext() ), actionCollection(), "next" ); next = new KAction( i18n( "Next" ), 0, 0, this, SLOT( slotNext() ), actionCollection(), "next" );
messages = new KAction( _( "Messages..." ), 0, 0, this, SLOT( slotShowMessages() ), actionCollection(), "view_messages");
fileOpen->setStatusText(i18n("Opens an existing document")); fileOpen->setStatusText(i18n("Opens an existing document"));
fileOpenRecent->setStatusText(i18n("Opens a recently used file")); fileOpenRecent->setStatusText(i18n("Opens a recently used file"));
...@@ -118,7 +120,8 @@ void KInterface::initActions() ...@@ -118,7 +120,8 @@ void KInterface::initActions()
next->setStatusText( i18n( "Next" ) ); next->setStatusText( i18n( "Next" ) );
// use the absolute path to your ktestui.rc file for testing purpose in createGUI(); // use the absolute path to your ktestui.rc file for testing purpose in createGUI();
createGUI( DATA_PATH "/vlc_kde_ui.rc" ); createGUI( DATA_PATH "/ui.rc" );
// createGUI( "./modules/gui/kde/ui.rc" );
} }
void KInterface::initStatusBar() void KInterface::initStatusBar()
...@@ -134,6 +137,10 @@ void KInterface::initStatusBar() ...@@ -134,6 +137,10 @@ void KInterface::initStatusBar()
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATION // SLOT IMPLEMENTATION
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
void KInterface::slotShowMessages()
{
p_messagesWindow->show();
}
void KInterface::slotFileOpen() void KInterface::slotFileOpen()
{ {
...@@ -231,6 +238,8 @@ void KInterface::slotStatusMsg(const QString &text) ...@@ -231,6 +238,8 @@ void KInterface::slotStatusMsg(const QString &text)
void KInterface::slotManage() void KInterface::slotManage()
{ {
p_messagesWindow->update();
p_intf->p_sys->p_app->processEvents();
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
/* Update the input */ /* Update the input */
...@@ -275,6 +284,7 @@ void KInterface::slotManage() ...@@ -275,6 +284,7 @@ void KInterface::slotManage()
} }
vlc_mutex_unlock( &p_intf->change_lock ); vlc_mutex_unlock( &p_intf->change_lock );
} }
void KInterface::slotSliderMoved( int position ) void KInterface::slotSliderMoved( int position )
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <qdragobject.h> #include <qdragobject.h>
#include <qstring.h> #include <qstring.h>
#include <qwidget.h> #include <qwidget.h>
#include "messages.h"
class KThread; class KThread;
class KDiskDialog; class KDiskDialog;
...@@ -67,6 +67,7 @@ class KInterface : public KMainWindow ...@@ -67,6 +67,7 @@ class KInterface : public KMainWindow
* @param text the text that is displayed in the statusbar * @param text the text that is displayed in the statusbar
*/ */
void slotStatusMsg( const QString &text ); void slotStatusMsg( const QString &text );
void slotShowMessages();
protected: protected:
/** initializes the KActions of the application */ /** initializes the KActions of the application */
...@@ -103,6 +104,7 @@ class KInterface : public KMainWindow ...@@ -103,6 +104,7 @@ class KInterface : public KMainWindow
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
KMessagesWindow *p_messagesWindow;
/** to call p_intf->pf_manage every now and then */ /** to call p_intf->pf_manage every now and then */
QTimer *fTimer; QTimer *fTimer;
...@@ -135,6 +137,7 @@ class KInterface : public KMainWindow ...@@ -135,6 +137,7 @@ class KInterface : public KMainWindow
KAction *fast; KAction *fast;
KAction *prev; KAction *prev;
KAction *next; KAction *next;
KAction *messages;
KAction *preferences; KAction *preferences;
}; };
...@@ -148,6 +151,7 @@ struct intf_sys_t ...@@ -148,6 +151,7 @@ struct intf_sys_t
KAboutData *p_about; KAboutData *p_about;
input_thread_t *p_input; input_thread_t *p_input;
msg_subscription_t *p_msg;
}; };
#endif /* _KDE_INTERFACE_H_ */ #endif /* _KDE_INTERFACE_H_ */
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* kde.cpp : KDE plugin for vlc * kde.cpp : KDE plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: kde.cpp,v 1.2 2002/08/18 13:14:39 sigmunau Exp $ * $Id: kde.cpp,v 1.3 2002/10/03 10:15:01 sigmunau Exp $
* *
* Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001 * Authors: Andres Krapf <dae@chez.com> Sun Mar 25 2001
* *
...@@ -94,6 +94,7 @@ static void close(vlc_object_t *p_this) ...@@ -94,6 +94,7 @@ static void close(vlc_object_t *p_this)
delete p_intf->p_sys->p_app; delete p_intf->p_sys->p_app;
delete p_intf->p_sys->p_about; delete p_intf->p_sys->p_about;
msg_Unsubscribe(p_intf, p_intf->p_sys->p_msg);
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
...@@ -113,19 +114,16 @@ void run(intf_thread_t *p_intf) ...@@ -113,19 +114,16 @@ void run(intf_thread_t *p_intf)
_("(C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 - the VideoLAN Team"), _("(C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 - the VideoLAN Team"),
0, 0, ""); 0, 0, "");
char *authors[][2] = { p_intf->p_sys->p_about->addAuthor( "the VideoLAN Team", 0,
{ "the VideoLAN Team", "<videolan@videolan.org>" }, "<videolan@videolan.org>" );
{ NULL, NULL },
};
for ( int i = 0; NULL != authors[i][0]; i++ ) {
p_intf->p_sys->p_about->addAuthor( authors[i][0], 0, authors[i][1] );
}
int argc = 1; int argc = 1;
char *argv[] = { p_intf->p_vlc->psz_object_name, NULL }; char *argv[] = { p_intf->p_vlc->psz_object_name, NULL };
KCmdLineArgs::init( argc, argv, p_intf->p_sys->p_about ); KCmdLineArgs::init( argc, argv, p_intf->p_sys->p_about );
/* Subscribe to message queue */
p_intf->p_sys->p_msg = msg_Subscribe( p_intf );
p_intf->p_sys->p_app = new KApplication(); p_intf->p_sys->p_app = new KApplication();
p_intf->p_sys->p_window = new KInterface(p_intf); p_intf->p_sys->p_window = new KInterface(p_intf);
p_intf->p_sys->p_window->setCaption( VOUT_TITLE " (KDE interface)" ); p_intf->p_sys->p_window->setCaption( VOUT_TITLE " (KDE interface)" );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* preferences.cpp: preferences window for the kde gui * preferences.cpp: preferences window for the kde gui
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: preferences.cpp,v 1.4 2002/08/15 12:11:15 sam Exp $ * $Id: preferences.cpp,v 1.5 2002/10/03 10:15:01 sigmunau Exp $
* *
* Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon Aug 12 2002 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no> Mon Aug 12 2002
* *
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include "preferences.h" #include "preferences.h"
/* /*
construkt a new configuration window for the given module construct a new configuration window for the given module
*/ */
KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name, KPreferences::KPreferences(intf_thread_t *p_intf, const char *psz_module_name,
QWidget *parent, const QString &caption) : QWidget *parent, const QString &caption) :
......
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
<Separator lineSeparator="true"/> <Separator lineSeparator="true"/>
<Action name="file_quit"/> <Action name="file_quit"/>
</Menu> </Menu>
<Menu name="view" noMerge="1">
<text>&amp;View</text>
<Action name="view_messages"/>
</Menu>
</MenuBar> </MenuBar>
<ToolBar name="mainToolBar" iconText="icononly" iconSize="16" noMerge="1"> <ToolBar name="mainToolBar" iconText="icononly" iconSize="16" noMerge="1">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment