13 changed files with 393 additions and 38 deletions
@ -0,0 +1,85 @@ |
|||
/*****************************************************************************
|
|||
* interaction.cpp : Interaction stuff |
|||
**************************************************************************** |
|||
* Copyright (C) 2000-2005 the VideoLAN team |
|||
* $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $ |
|||
* |
|||
* Authors: Clément Stenac <zorglub@videolan.org> |
|||
* |
|||
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ |
|||
|
|||
#include "dialogs/interaction.hpp" |
|||
#include <vlc/intf.h> |
|||
|
|||
InteractionDialog::InteractionDialog( intf_thread_t *_p_intf, |
|||
interaction_dialog_t *_p_dialog ) : |
|||
p_intf( _p_intf), p_dialog( _p_dialog ) |
|||
{ |
|||
if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL ) |
|||
{ |
|||
uiOkCancel = new Ui::OKCancelDialog; |
|||
uiOkCancel->setupUi( this ); |
|||
uiOkCancel->description->setText( p_dialog->psz_description ); |
|||
connect( uiOkCancel->okButton, SIGNAL( clicked() ), |
|||
this, SLOT( OK() ) ); |
|||
connect( uiOkCancel->cancelButton, SIGNAL( clicked() ), |
|||
this, SLOT( cancel() ) ); |
|||
} |
|||
else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL ) |
|||
{ |
|||
|
|||
} |
|||
else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL ) |
|||
{ |
|||
|
|||
} |
|||
else if( p_dialog->i_flags & DIALOG_USER_PROGRESS ) |
|||
{ |
|||
|
|||
} |
|||
else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL ) |
|||
{ |
|||
} |
|||
else |
|||
msg_Err( p_intf, "unknown dialog type" ); |
|||
} |
|||
|
|||
void InteractionDialog::Update() |
|||
{ |
|||
} |
|||
|
|||
InteractionDialog::~InteractionDialog() |
|||
{ |
|||
} |
|||
|
|||
void InteractionDialog::OK() |
|||
{ |
|||
Finish( DIALOG_OK_YES, NULL, NULL ); |
|||
} |
|||
|
|||
void InteractionDialog::cancel() |
|||
{ |
|||
Finish( DIALOG_CANCELLED, NULL, NULL ); |
|||
} |
|||
|
|||
void InteractionDialog::Finish( int i_ret, QString *r1, QString *r2 ) |
|||
{ |
|||
vlc_mutex_lock( &p_dialog->p_interaction->object_lock ); |
|||
|
|||
p_dialog->i_status = ANSWERED_DIALOG; |
|||
p_dialog->i_return = i_ret; |
|||
hide(); |
|||
vlc_mutex_unlock( &p_dialog->p_interaction->object_lock ); |
|||
} |
|||
@ -0,0 +1,50 @@ |
|||
/*****************************************************************************
|
|||
* interaction.hpp : Interaction dialogs |
|||
**************************************************************************** |
|||
* Copyright (C) 2000-2005 the VideoLAN team |
|||
* $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $ |
|||
* |
|||
* Authors: Clément Stenac <zorglub@videolan.org> |
|||
* |
|||
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ |
|||
|
|||
#ifndef _INTERACTION_H_ |
|||
#define _INTERACTION_H_ |
|||
|
|||
#include <vlc/vlc.h> |
|||
#include <vlc_interaction.h> |
|||
#include <ui/okcanceldialog.h> |
|||
|
|||
class InteractionDialog : public QWidget |
|||
{ |
|||
Q_OBJECT |
|||
public: |
|||
InteractionDialog( intf_thread_t *, interaction_dialog_t * ); |
|||
virtual ~InteractionDialog(); |
|||
|
|||
void Update(); |
|||
|
|||
private: |
|||
intf_thread_t *p_intf; |
|||
interaction_dialog_t *p_dialog; |
|||
Ui::OKCancelDialog *uiOkCancel; |
|||
|
|||
void Finish( int, QString *, QString * ); |
|||
private slots: |
|||
void OK(); |
|||
void cancel(); |
|||
}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,71 @@ |
|||
<ui version="4.0" > |
|||
<author></author> |
|||
<comment></comment> |
|||
<exportmacro></exportmacro> |
|||
<class>OKCancelDialog</class> |
|||
<widget class="QWidget" name="OKCancelDialog" > |
|||
<property name="geometry" > |
|||
<rect> |
|||
<x>0</x> |
|||
<y>0</y> |
|||
<width>400</width> |
|||
<height>122</height> |
|||
</rect> |
|||
</property> |
|||
<layout class="QVBoxLayout" > |
|||
<property name="margin" > |
|||
<number>9</number> |
|||
</property> |
|||
<property name="spacing" > |
|||
<number>6</number> |
|||
</property> |
|||
<item> |
|||
<widget class="QLabel" name="description" > |
|||
<property name="text" > |
|||
<string/> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item> |
|||
<layout class="QHBoxLayout" > |
|||
<property name="margin" > |
|||
<number>0</number> |
|||
</property> |
|||
<property name="spacing" > |
|||
<number>6</number> |
|||
</property> |
|||
<item> |
|||
<spacer> |
|||
<property name="orientation" > |
|||
<enum>Qt::Horizontal</enum> |
|||
</property> |
|||
<property name="sizeHint" > |
|||
<size> |
|||
<width>40</width> |
|||
<height>20</height> |
|||
</size> |
|||
</property> |
|||
</spacer> |
|||
</item> |
|||
<item> |
|||
<widget class="QPushButton" name="okButton" > |
|||
<property name="text" > |
|||
<string>OK</string> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
<item> |
|||
<widget class="QPushButton" name="cancelButton" > |
|||
<property name="text" > |
|||
<string>Cancel</string> |
|||
</property> |
|||
</widget> |
|||
</item> |
|||
</layout> |
|||
</item> |
|||
</layout> |
|||
</widget> |
|||
<pixmapfunction></pixmapfunction> |
|||
<resources/> |
|||
<connections/> |
|||
</ui> |
|||
Loading…
Reference in new issue