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 = \
modules/gui/kde/menu.cpp \
modules/gui/kde/preferences.cpp \
modules/gui/kde/pluginsbox.cpp \
modules/gui/kde/QConfigItem.cpp
modules/gui/kde/QConfigItem.cpp \
modules/gui/kde/messages.cpp
nodist_SOURCES_kde = \
modules/gui/kde/interface.moc.cpp \
......@@ -17,7 +18,8 @@ nodist_SOURCES_kde = \
modules/gui/kde/menu.moc.cpp \
modules/gui/kde/preferences.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 += \
modules/gui/kde/common.h \
......@@ -28,7 +30,8 @@ noinst_HEADERS += \
modules/gui/kde/net.h \
modules/gui/kde/pluginsbox.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
$(MOC) $< -o $@
......@@ -46,5 +49,7 @@ modules/gui/kde/pluginsbox.moc.cpp: modules/gui/kde/pluginsbox.h
$(MOC) $< -o $@
modules/gui/kde/QConfigItem.moc.cpp: modules/gui/kde/QConfigItem.h
$(MOC) $< -o $@
modules/gui/kde/messages.moc.cpp: modules/gui/kde/messages.h
$(MOC) $< -o $@
EXTRA_DIST += modules/gui/kde/ui.rc
......@@ -37,7 +37,8 @@ KInterface::KInterface( intf_thread_t *p_intf, QWidget *parent,
setAcceptDrops(true);
this->p_intf = p_intf;
p_messagesWindow = new KMessagesWindow( p_intf, p_intf->p_sys->p_msg );
p_messagesWindow->show();
fDiskDialog = new KDiskDialog( this );
fNetDialog = new KNetDialog( this );
fTitleMenu = new KTitleMenu( p_intf, this );
......@@ -98,6 +99,7 @@ void KInterface::initActions()
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" );
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"));
fileOpenRecent->setStatusText(i18n("Opens a recently used file"));
......@@ -118,7 +120,8 @@ void KInterface::initActions()
next->setStatusText( i18n( "Next" ) );
// 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()
......@@ -134,6 +137,10 @@ void KInterface::initStatusBar()
/////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATION
/////////////////////////////////////////////////////////////////////
void KInterface::slotShowMessages()
{
p_messagesWindow->show();
}
void KInterface::slotFileOpen()
{
......@@ -231,6 +238,8 @@ void KInterface::slotStatusMsg(const QString &text)
void KInterface::slotManage()
{
p_messagesWindow->update();
p_intf->p_sys->p_app->processEvents();
vlc_mutex_lock( &p_intf->change_lock );
/* Update the input */
......@@ -275,6 +284,7 @@ void KInterface::slotManage()
}
vlc_mutex_unlock( &p_intf->change_lock );
}
void KInterface::slotSliderMoved( int position )
......
......@@ -17,7 +17,7 @@
#include <qdragobject.h>
#include <qstring.h>
#include <qwidget.h>
#include "messages.h"
class KThread;
class KDiskDialog;
......@@ -67,6 +67,7 @@ class KInterface : public KMainWindow
* @param text the text that is displayed in the statusbar
*/
void slotStatusMsg( const QString &text );
void slotShowMessages();
protected:
/** initializes the KActions of the application */
......@@ -103,6 +104,7 @@ class KInterface : public KMainWindow
private:
intf_thread_t *p_intf;
KMessagesWindow *p_messagesWindow;
/** to call p_intf->pf_manage every now and then */
QTimer *fTimer;
......@@ -135,6 +137,7 @@ class KInterface : public KMainWindow
KAction *fast;
KAction *prev;
KAction *next;
KAction *messages;
KAction *preferences;
};
......@@ -148,6 +151,7 @@ struct intf_sys_t
KAboutData *p_about;
input_thread_t *p_input;
msg_subscription_t *p_msg;
};
#endif /* _KDE_INTERFACE_H_ */
......@@ -2,7 +2,7 @@
* kde.cpp : KDE plugin for vlc
*****************************************************************************
* 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
*
......@@ -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_about;
msg_Unsubscribe(p_intf, p_intf->p_sys->p_msg);
free( p_intf->p_sys );
}
......@@ -113,19 +114,16 @@ void run(intf_thread_t *p_intf)
_("(C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 - the VideoLAN Team"),
0, 0, "");
char *authors[][2] = {
{ "the VideoLAN Team", "<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] );
}
p_intf->p_sys->p_about->addAuthor( "the VideoLAN Team", 0,
"<videolan@videolan.org>" );
int argc = 1;
char *argv[] = { p_intf->p_vlc->psz_object_name, NULL };
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_window = new KInterface(p_intf);
p_intf->p_sys->p_window->setCaption( VOUT_TITLE " (KDE interface)" );
......
......@@ -2,7 +2,7 @@
* preferences.cpp: preferences window for the kde gui
*****************************************************************************
* 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
*
......@@ -44,7 +44,7 @@
#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,
QWidget *parent, const QString &caption) :
......
......@@ -24,6 +24,10 @@
<Separator lineSeparator="true"/>
<Action name="file_quit"/>
</Menu>
<Menu name="view" noMerge="1">
<text>&amp;View</text>
<Action name="view_messages"/>
</Menu>
</MenuBar>
<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