Commit da0187a3 authored by Olivier Teulière's avatar Olivier Teulière

 * backported my previous commit
parent c8d6aecd
...@@ -326,12 +326,12 @@ void __fastcall TMainFrameDlg::ToolButtonEjectClick( TObject *Sender ) ...@@ -326,12 +326,12 @@ void __fastcall TMainFrameDlg::ToolButtonEjectClick( TObject *Sender )
} }
/* If there's a stream playing, we aren't allowed to eject ! */ /* If there's a stream playing, we aren't allowed to eject ! */
// if( p_input_bank->pp_input[0] == NULL ) if( p_input_bank->pp_input[0] == NULL )
// { {
intf_WarnMsg( 4, "intf: ejecting %s", Device.c_str() ); intf_WarnMsg( 4, "intf: ejecting %s", Device.c_str() );
intf_Eject( Device.c_str() ); intf_Eject( Device.c_str() );
// } }
} }
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
...@@ -628,7 +628,7 @@ void __fastcall TMainFrameDlg::ModeManage() ...@@ -628,7 +628,7 @@ void __fastcall TMainFrameDlg::ModeManage()
break; break;
} }
i_Height = StatusBar->Height + ActiveGB->Height + ToolBar->Height + 47; i_Height = StatusBar->Height + ActiveGB->Height + ToolBar->Height + 54;
/* initialize and show slider for seekable streams */ /* initialize and show slider for seekable streams */
if( p_input_bank->pp_input[0]->stream.b_seekable ) if( p_input_bank->pp_input[0]->stream.b_seekable )
...@@ -660,13 +660,13 @@ void __fastcall TMainFrameDlg::ModeManage() ...@@ -660,13 +660,13 @@ void __fastcall TMainFrameDlg::ModeManage()
{ {
GroupBoxNetwork->Visible = true; GroupBoxNetwork->Visible = true;
LabelChannel->Visible = true; LabelChannel->Visible = true;
i_Height += GroupBoxNetwork->Height; i_Height += GroupBoxNetwork->Height + 7;
} }
else else
{ {
/* add space between tolbar and statusbar when /* add space between tolbar and statusbar when
* nothing is displayed; isn't it nicer ? :) */ * nothing is displayed; isn't it nicer ? :) */
i_Height += 18; i_Height += 17;
/* unsensitize menus */ /* unsensitize menus */
MenuProgram->Enabled = false; MenuProgram->Enabled = false;
...@@ -686,7 +686,7 @@ void __fastcall TMainFrameDlg::ModeManage() ...@@ -686,7 +686,7 @@ void __fastcall TMainFrameDlg::ModeManage()
/* set control items */ /* set control items */
ToolButtonBack->Enabled = false; ToolButtonBack->Enabled = false;
ToolButtonStop->Enabled = true; ToolButtonStop->Enabled = true;
ToolButtonEject->Enabled = b_control; ToolButtonEject->Enabled = !b_control;
ToolButtonPause->Enabled = b_control; ToolButtonPause->Enabled = b_control;
ToolButtonSlow->Enabled = b_control; ToolButtonSlow->Enabled = b_control;
ToolButtonFast->Enabled = b_control; ToolButtonFast->Enabled = b_control;
......
...@@ -141,16 +141,18 @@ object MainFrameDlg: TMainFrameDlg ...@@ -141,16 +141,18 @@ object MainFrameDlg: TMainFrameDlg
Left = 0 Left = 0
Top = 0 Top = 0
Width = 533 Width = 533
Height = 60 Height = 50
ButtonHeight = 46 ButtonHeight = 46
ButtonWidth = 39 ButtonWidth = 39
Caption = 'ToolBar' Caption = 'ToolBar'
EdgeBorders = [ebTop, ebBottom]
Flat = True
Images = ImageListToolbar Images = ImageListToolbar
ShowCaptions = True ShowCaptions = True
TabOrder = 0 TabOrder = 0
object ToolButtonFile: TToolButton object ToolButtonFile: TToolButton
Left = 0 Left = 0
Top = 2 Top = 0
Hint = 'Open a file' Hint = 'Open a file'
Caption = 'File' Caption = 'File'
ImageIndex = 0 ImageIndex = 0
...@@ -158,7 +160,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -158,7 +160,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonDisc: TToolButton object ToolButtonDisc: TToolButton
Left = 39 Left = 39
Top = 2 Top = 0
Hint = 'Open a DVD or VCD' Hint = 'Open a DVD or VCD'
Caption = 'Disc' Caption = 'Disc'
ImageIndex = 1 ImageIndex = 1
...@@ -166,7 +168,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -166,7 +168,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonNet: TToolButton object ToolButtonNet: TToolButton
Left = 78 Left = 78
Top = 2 Top = 0
Hint = 'Open a network stream' Hint = 'Open a network stream'
Caption = 'Net' Caption = 'Net'
ImageIndex = 2 ImageIndex = 2
...@@ -174,7 +176,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -174,7 +176,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonSep1: TToolButton object ToolButtonSep1: TToolButton
Left = 117 Left = 117
Top = 2 Top = 0
Width = 8 Width = 8
Caption = 'ToolButtonSep1' Caption = 'ToolButtonSep1'
ImageIndex = 3 ImageIndex = 3
...@@ -182,7 +184,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -182,7 +184,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonBack: TToolButton object ToolButtonBack: TToolButton
Left = 125 Left = 125
Top = 2 Top = 0
Caption = 'Back' Caption = 'Back'
Enabled = False Enabled = False
ImageIndex = 3 ImageIndex = 3
...@@ -190,7 +192,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -190,7 +192,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonPlay: TToolButton object ToolButtonPlay: TToolButton
Left = 164 Left = 164
Top = 2 Top = 0
Hint = 'Play stream' Hint = 'Play stream'
Caption = 'Play' Caption = 'Play'
ImageIndex = 5 ImageIndex = 5
...@@ -198,7 +200,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -198,7 +200,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonPause: TToolButton object ToolButtonPause: TToolButton
Left = 203 Left = 203
Top = 2 Top = 0
Hint = 'Pause stream' Hint = 'Pause stream'
Caption = 'Pause' Caption = 'Pause'
Enabled = False Enabled = False
...@@ -207,7 +209,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -207,7 +209,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonStop: TToolButton object ToolButtonStop: TToolButton
Left = 242 Left = 242
Top = 2 Top = 0
Hint = 'Stop stream' Hint = 'Stop stream'
Caption = 'Stop' Caption = 'Stop'
Enabled = False Enabled = False
...@@ -216,16 +218,16 @@ object MainFrameDlg: TMainFrameDlg ...@@ -216,16 +218,16 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonEject: TToolButton object ToolButtonEject: TToolButton
Left = 281 Left = 281
Top = 2 Top = 0
Hint = 'Eject disc' Hint = 'Eject disc'
Caption = 'Eject' Caption = 'Eject'
Enabled = True Enabled = False
ImageIndex = 7 ImageIndex = 7
OnClick = ToolButtonEjectClick OnClick = ToolButtonEjectClick
end end
object ToolButton1: TToolButton object ToolButton1: TToolButton
Left = 320 Left = 320
Top = 2 Top = 0
Width = 8 Width = 8
Caption = 'ToolButton1' Caption = 'ToolButton1'
ImageIndex = 13 ImageIndex = 13
...@@ -233,7 +235,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -233,7 +235,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonSlow: TToolButton object ToolButtonSlow: TToolButton
Left = 328 Left = 328
Top = 2 Top = 0
Hint = 'Play slower' Hint = 'Play slower'
Caption = 'Slow' Caption = 'Slow'
Enabled = False Enabled = False
...@@ -242,7 +244,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -242,7 +244,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonFast: TToolButton object ToolButtonFast: TToolButton
Left = 367 Left = 367
Top = 2 Top = 0
Hint = 'Play faster' Hint = 'Play faster'
Caption = 'Fast' Caption = 'Fast'
Enabled = False Enabled = False
...@@ -251,7 +253,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -251,7 +253,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonSep2: TToolButton object ToolButtonSep2: TToolButton
Left = 406 Left = 406
Top = 2 Top = 0
Width = 8 Width = 8
Caption = 'ToolButtonSep2' Caption = 'ToolButtonSep2'
ImageIndex = 9 ImageIndex = 9
...@@ -259,7 +261,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -259,7 +261,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonPlaylist: TToolButton object ToolButtonPlaylist: TToolButton
Left = 414 Left = 414
Top = 2 Top = 0
Hint = 'Open playlist' Hint = 'Open playlist'
Caption = 'Playlist' Caption = 'Playlist'
ImageIndex = 10 ImageIndex = 10
...@@ -268,7 +270,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -268,7 +270,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonPrev: TToolButton object ToolButtonPrev: TToolButton
Left = 453 Left = 453
Top = 2 Top = 0
Hint = 'Previous file' Hint = 'Previous file'
Caption = 'Prev' Caption = 'Prev'
ImageIndex = 11 ImageIndex = 11
...@@ -276,7 +278,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -276,7 +278,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object ToolButtonNext: TToolButton object ToolButtonNext: TToolButton
Left = 492 Left = 492
Top = 2 Top = 0
Hint = 'Next file' Hint = 'Next file'
Caption = 'Next' Caption = 'Next'
ImageIndex = 12 ImageIndex = 12
...@@ -295,7 +297,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -295,7 +297,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object GroupBoxFile: TGroupBox object GroupBoxFile: TGroupBox
Left = 0 Left = 0
Top = 100 Top = 90
Width = 533 Width = 533
Height = 32 Height = 32
Align = alTop Align = alTop
...@@ -313,7 +315,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -313,7 +315,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object GroupBoxNetwork: TGroupBox object GroupBoxNetwork: TGroupBox
Left = 0 Left = 0
Top = 164 Top = 154
Width = 533 Width = 533
Height = 40 Height = 40
Align = alTop Align = alTop
...@@ -355,7 +357,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -355,7 +357,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object GroupBoxDisc: TGroupBox object GroupBoxDisc: TGroupBox
Left = 0 Left = 0
Top = 132 Top = 122
Width = 533 Width = 533
Height = 32 Height = 32
Align = alTop Align = alTop
...@@ -439,7 +441,7 @@ object MainFrameDlg: TMainFrameDlg ...@@ -439,7 +441,7 @@ object MainFrameDlg: TMainFrameDlg
end end
object GroupBoxSlider: TGroupBox object GroupBoxSlider: TGroupBox
Left = 0 Left = 0
Top = 60 Top = 50
Width = 533 Width = 533
Height = 40 Height = 40
Align = alTop Align = alTop
......
...@@ -61,8 +61,8 @@ void __fastcall TMessagesDlg::FormShow( TObject *Sender ) ...@@ -61,8 +61,8 @@ void __fastcall TMessagesDlg::FormShow( TObject *Sender )
void __fastcall TMessagesDlg::UpdateLog() void __fastcall TMessagesDlg::UpdateLog()
{ {
intf_subscription_t *p_sub = p_intfGlobal->p_sys->p_sub; intf_subscription_t *p_sub = p_intfGlobal->p_sys->p_sub;
int i_start; int i_start, i_stop, i_del, i_count;
int i_stop; int i_max_lines;
vlc_mutex_lock( p_sub->p_lock ); vlc_mutex_lock( p_sub->p_lock );
i_stop = *p_sub->pi_stop; i_stop = *p_sub->pi_stop;
...@@ -88,8 +88,23 @@ void __fastcall TMessagesDlg::UpdateLog() ...@@ -88,8 +88,23 @@ void __fastcall TMessagesDlg::UpdateLog()
break; break;
} }
/* Limit log size */
i_count = RichEditMessages->Lines->Count;
i_max_lines = config_GetIntVariable( "intfwin-max-lines" );
if( i_max_lines > 0 )
{
for( i_del = 0; i_del <= i_count - i_max_lines; i_del++ )
{
RichEditMessages->Lines->Delete( 0 );
}
}
/* Add message */
if( i_max_lines )
{
RichEditMessages->Lines->Add( p_sub->p_msg[i_start].psz_msg ); RichEditMessages->Lines->Add( p_sub->p_msg[i_start].psz_msg );
} }
}
vlc_mutex_lock( p_sub->p_lock ); vlc_mutex_lock( p_sub->p_lock );
p_sub->i_start = i_start; p_sub->i_start = i_start;
......
...@@ -22,6 +22,12 @@ object MessagesDlg: TMessagesDlg ...@@ -22,6 +22,12 @@ object MessagesDlg: TMessagesDlg
Height = 424 Height = 424
Align = alTop Align = alTop
Anchors = [akLeft, akTop, akRight, akBottom] Anchors = [akLeft, akTop, akRight, akBottom]
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
ReadOnly = True ReadOnly = True
ScrollBars = ssBoth ScrollBars = ssBoth
TabOrder = 0 TabOrder = 0
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <StdCtrls.hpp> #include <StdCtrls.hpp>
#include <Forms.hpp> #include <Forms.hpp>
#include <ComCtrls.hpp> #include <ComCtrls.hpp>
#include <Menus.hpp>
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
class TMessagesDlg : public TForm class TMessagesDlg : public TForm
{ {
......
...@@ -38,7 +38,15 @@ void _M( intf_getfunctions ) ( function_list_t * p_function_list ); ...@@ -38,7 +38,15 @@ void _M( intf_getfunctions ) ( function_list_t * p_function_list );
/***************************************************************************** /*****************************************************************************
* Build configuration tree. * Build configuration tree.
*****************************************************************************/ *****************************************************************************/
#define MAX_LINES_TEXT N_("maximum number of lines in the log window")
#define MAX_LINES_LONGTEXT N_( \
"You can set the maximum number of lines that the log window will display."\
" Enter -1 if you want to keep all messages." )
MODULE_CONFIG_START MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
ADD_INTEGER( "intfwin-max-lines", 500, NULL, MAX_LINES_TEXT, MAX_LINES_LONGTEXT )
MODULE_CONFIG_STOP MODULE_CONFIG_STOP
MODULE_INIT_START MODULE_INIT_START
......
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