Commit 97f221eb authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Small open dialog refactoring for use for vlm dialog.

parent fee86c5d
This diff is collapsed.
...@@ -40,25 +40,12 @@ class OpenDialog : public QVLCDialog ...@@ -40,25 +40,12 @@ class OpenDialog : public QVLCDialog
Q_OBJECT; Q_OBJECT;
public: public:
static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf, static OpenDialog * getInstance( QWidget *parent, intf_thread_t *p_intf,
int _action_flag = 0 ) int _action_flag = 0, bool modal = false );
{
if( !instance )
instance = new OpenDialog( parent, p_intf, false, _action_flag );
else
{
instance->i_action_flag = _action_flag;
instance->setMenuAction();
}
return instance;
}
OpenDialog( QWidget *parent, intf_thread_t *, bool modal,
int _action_flag = 0 );
virtual ~OpenDialog(); virtual ~OpenDialog();
void showTab( int ); void showTab( int );
QString getMRL(){ return mrl; }
QString mrl;
QString mainMRL;
public slots: public slots:
void selectSlots(); void selectSlots();
...@@ -66,24 +53,30 @@ public slots: ...@@ -66,24 +53,30 @@ public slots:
void stream( bool b_transode_only = false ); void stream( bool b_transode_only = false );
void enqueue(); void enqueue();
void transcode(); void transcode();
private: private:
OpenDialog( QWidget *parent, intf_thread_t *, bool modal,
int _action_flag = 0 );
static OpenDialog *instance; static OpenDialog *instance;
input_thread_t *p_input; input_thread_t *p_input;
QString mrl;
QString mainMRL;
QString storedMethod;
Ui::Open ui; Ui::Open ui;
FileOpenPanel *fileOpenPanel; FileOpenPanel *fileOpenPanel;
NetOpenPanel *netOpenPanel; NetOpenPanel *netOpenPanel;
DiscOpenPanel *discOpenPanel; DiscOpenPanel *discOpenPanel;
CaptureOpenPanel *captureOpenPanel; CaptureOpenPanel *captureOpenPanel;
QString storedMethod;
QString mrlSub;
int advHeight, mainHeight;
int i_action_flag; int i_action_flag;
QStringList SeparateEntries( QString ); QStringList SeparateEntries( QString );
QPushButton *cancelButton; QPushButton *cancelButton, *selectButton;
QToolButton *playButton; QToolButton *playButton;
void finish( bool ); void finish( bool );
private slots: private slots:
......
...@@ -127,6 +127,7 @@ void DialogsProvider::customEvent( QEvent *event ) ...@@ -127,6 +127,7 @@ void DialogsProvider::customEvent( QEvent *event )
QVLCMenu::MiscPopupMenu( p_intf ); break; QVLCMenu::MiscPopupMenu( p_intf ); break;
case INTF_DIALOG_WIZARD: case INTF_DIALOG_WIZARD:
case INTF_DIALOG_STREAMWIZARD: case INTF_DIALOG_STREAMWIZARD:
openThenStreamingDialogs(); break;
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
case INTF_DIALOG_UPDATEVLC: case INTF_DIALOG_UPDATEVLC:
updateDialog(); break; updateDialog(); break;
...@@ -249,8 +250,7 @@ void DialogsProvider::PLAppendDialog() ...@@ -249,8 +250,7 @@ void DialogsProvider::PLAppendDialog()
/* Unimplemmented yet - Usefull ? */ /* Unimplemmented yet - Usefull ? */
void DialogsProvider::MLAppendDialog() void DialogsProvider::MLAppendDialog()
{ {}
}
/** /**
* Simple open * Simple open
...@@ -414,14 +414,13 @@ void DialogsProvider::saveAPlaylist() ...@@ -414,14 +414,13 @@ void DialogsProvider::saveAPlaylist()
* Sout emulation * Sout emulation
****************************************************************************/ ****************************************************************************/
//FIXME !!
void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only ) void DialogsProvider::streamingDialog( QString mrl, bool b_transcode_only )
{ {
SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf, SoutDialog *s = new SoutDialog( p_intf->p_sys->p_mi, p_intf,
b_transcode_only ); b_transcode_only );
if( s->exec() == QDialog::Accepted ) if( s->exec() == QDialog::Accepted )
{ {
msg_Err( p_intf, "mrl %s", qta( s->getMrl() ) ); msg_Err( p_intf, "Sout mrl %s", qta( s->getMrl() ) );
/* Just do it */ /* Just do it */
int i_len = strlen( qtu( s->getMrl() ) ) + 10; int i_len = strlen( qtu( s->getMrl() ) ) + 10;
char *psz_option = (char*)malloc( i_len ); char *psz_option = (char*)malloc( i_len );
......
...@@ -84,7 +84,8 @@ enum { ...@@ -84,7 +84,8 @@ enum {
OPEN_AND_PLAY, OPEN_AND_PLAY,
OPEN_AND_STREAM, OPEN_AND_STREAM,
OPEN_AND_SAVE, OPEN_AND_SAVE,
OPEN_AND_ENQUEUE OPEN_AND_ENQUEUE,
SELECT
}; };
class QEvent; class QEvent;
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
<hsizetype>5</hsizetype>
<vsizetype>1</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -25,18 +23,25 @@ ...@@ -25,18 +23,25 @@
<string>Dialog</string> <string>Dialog</string>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>9</number>
</property>
<item> <item>
<widget class="QTabWidget" name="Tab" > <widget class="QTabWidget" name="Tab" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -59,9 +64,7 @@ ...@@ -59,9 +64,7 @@
<item> <item>
<widget class="QFrame" name="advancedFrame" > <widget class="QFrame" name="advancedFrame" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
<hsizetype>1</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -70,10 +73,22 @@ ...@@ -70,10 +73,22 @@
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>9</number>
</property>
<property name="rightMargin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="bottomMargin" >
<number>9</number>
</property>
<property name="horizontalSpacing" >
<number>6</number>
</property>
<property name="verticalSpacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="0" column="2" > <item row="0" column="2" >
...@@ -86,9 +101,7 @@ ...@@ -86,9 +101,7 @@
<item row="0" column="3" colspan="2" > <item row="0" column="3" colspan="2" >
<widget class="QSpinBox" name="startTimeSpinBox" > <widget class="QSpinBox" name="startTimeSpinBox" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -110,9 +123,7 @@ ...@@ -110,9 +123,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="cacheLabel" > <widget class="QLabel" name="cacheLabel" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -180,9 +191,7 @@ ...@@ -180,9 +191,7 @@
<item row="0" column="1" > <item row="0" column="1" >
<widget class="QSpinBox" name="cacheSpinBox" > <widget class="QSpinBox" name="cacheSpinBox" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -222,12 +231,21 @@ ...@@ -222,12 +231,21 @@
</item> </item>
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
......
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