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 )
}
/* 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_Eject( Device.c_str() );
// }
}
}
//--------------------------------------------------------------------------
......@@ -628,7 +628,7 @@ void __fastcall TMainFrameDlg::ModeManage()
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 */
if( p_input_bank->pp_input[0]->stream.b_seekable )
......@@ -660,13 +660,13 @@ void __fastcall TMainFrameDlg::ModeManage()
{
GroupBoxNetwork->Visible = true;
LabelChannel->Visible = true;
i_Height += GroupBoxNetwork->Height;
i_Height += GroupBoxNetwork->Height + 7;
}
else
{
/* add space between tolbar and statusbar when
* nothing is displayed; isn't it nicer ? :) */
i_Height += 18;
i_Height += 17;
/* unsensitize menus */
MenuProgram->Enabled = false;
......@@ -686,7 +686,7 @@ void __fastcall TMainFrameDlg::ModeManage()
/* set control items */
ToolButtonBack->Enabled = false;
ToolButtonStop->Enabled = true;
ToolButtonEject->Enabled = b_control;
ToolButtonEject->Enabled = !b_control;
ToolButtonPause->Enabled = b_control;
ToolButtonSlow->Enabled = b_control;
ToolButtonFast->Enabled = b_control;
......
......@@ -141,16 +141,18 @@ object MainFrameDlg: TMainFrameDlg
Left = 0
Top = 0
Width = 533
Height = 60
Height = 50
ButtonHeight = 46
ButtonWidth = 39
Caption = 'ToolBar'
EdgeBorders = [ebTop, ebBottom]
Flat = True
Images = ImageListToolbar
ShowCaptions = True
TabOrder = 0
object ToolButtonFile: TToolButton
Left = 0
Top = 2
Top = 0
Hint = 'Open a file'
Caption = 'File'
ImageIndex = 0
......@@ -158,7 +160,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonDisc: TToolButton
Left = 39
Top = 2
Top = 0
Hint = 'Open a DVD or VCD'
Caption = 'Disc'
ImageIndex = 1
......@@ -166,7 +168,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonNet: TToolButton
Left = 78
Top = 2
Top = 0
Hint = 'Open a network stream'
Caption = 'Net'
ImageIndex = 2
......@@ -174,7 +176,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonSep1: TToolButton
Left = 117
Top = 2
Top = 0
Width = 8
Caption = 'ToolButtonSep1'
ImageIndex = 3
......@@ -182,7 +184,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonBack: TToolButton
Left = 125
Top = 2
Top = 0
Caption = 'Back'
Enabled = False
ImageIndex = 3
......@@ -190,7 +192,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonPlay: TToolButton
Left = 164
Top = 2
Top = 0
Hint = 'Play stream'
Caption = 'Play'
ImageIndex = 5
......@@ -198,7 +200,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonPause: TToolButton
Left = 203
Top = 2
Top = 0
Hint = 'Pause stream'
Caption = 'Pause'
Enabled = False
......@@ -207,7 +209,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonStop: TToolButton
Left = 242
Top = 2
Top = 0
Hint = 'Stop stream'
Caption = 'Stop'
Enabled = False
......@@ -216,16 +218,16 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonEject: TToolButton
Left = 281
Top = 2
Top = 0
Hint = 'Eject disc'
Caption = 'Eject'
Enabled = True
Enabled = False
ImageIndex = 7
OnClick = ToolButtonEjectClick
end
object ToolButton1: TToolButton
Left = 320
Top = 2
Top = 0
Width = 8
Caption = 'ToolButton1'
ImageIndex = 13
......@@ -233,7 +235,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonSlow: TToolButton
Left = 328
Top = 2
Top = 0
Hint = 'Play slower'
Caption = 'Slow'
Enabled = False
......@@ -242,7 +244,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonFast: TToolButton
Left = 367
Top = 2
Top = 0
Hint = 'Play faster'
Caption = 'Fast'
Enabled = False
......@@ -251,7 +253,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonSep2: TToolButton
Left = 406
Top = 2
Top = 0
Width = 8
Caption = 'ToolButtonSep2'
ImageIndex = 9
......@@ -259,7 +261,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonPlaylist: TToolButton
Left = 414
Top = 2
Top = 0
Hint = 'Open playlist'
Caption = 'Playlist'
ImageIndex = 10
......@@ -268,7 +270,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonPrev: TToolButton
Left = 453
Top = 2
Top = 0
Hint = 'Previous file'
Caption = 'Prev'
ImageIndex = 11
......@@ -276,7 +278,7 @@ object MainFrameDlg: TMainFrameDlg
end
object ToolButtonNext: TToolButton
Left = 492
Top = 2
Top = 0
Hint = 'Next file'
Caption = 'Next'
ImageIndex = 12
......@@ -295,7 +297,7 @@ object MainFrameDlg: TMainFrameDlg
end
object GroupBoxFile: TGroupBox
Left = 0
Top = 100
Top = 90
Width = 533
Height = 32
Align = alTop
......@@ -313,7 +315,7 @@ object MainFrameDlg: TMainFrameDlg
end
object GroupBoxNetwork: TGroupBox
Left = 0
Top = 164
Top = 154
Width = 533
Height = 40
Align = alTop
......@@ -355,7 +357,7 @@ object MainFrameDlg: TMainFrameDlg
end
object GroupBoxDisc: TGroupBox
Left = 0
Top = 132
Top = 122
Width = 533
Height = 32
Align = alTop
......@@ -439,7 +441,7 @@ object MainFrameDlg: TMainFrameDlg
end
object GroupBoxSlider: TGroupBox
Left = 0
Top = 60
Top = 50
Width = 533
Height = 40
Align = alTop
......
......@@ -61,8 +61,8 @@ void __fastcall TMessagesDlg::FormShow( TObject *Sender )
void __fastcall TMessagesDlg::UpdateLog()
{
intf_subscription_t *p_sub = p_intfGlobal->p_sys->p_sub;
int i_start;
int i_stop;
int i_start, i_stop, i_del, i_count;
int i_max_lines;
vlc_mutex_lock( p_sub->p_lock );
i_stop = *p_sub->pi_stop;
......@@ -88,8 +88,23 @@ void __fastcall TMessagesDlg::UpdateLog()
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 );
}
}
vlc_mutex_lock( p_sub->p_lock );
p_sub->i_start = i_start;
......
......@@ -22,6 +22,12 @@ object MessagesDlg: TMessagesDlg
Height = 424
Align = alTop
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
ScrollBars = ssBoth
TabOrder = 0
......
......@@ -28,6 +28,7 @@
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TMessagesDlg : public TForm
{
......
......@@ -38,7 +38,15 @@ void _M( intf_getfunctions ) ( function_list_t * p_function_list );
/*****************************************************************************
* 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
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
ADD_INTEGER( "intfwin-max-lines", 500, NULL, MAX_LINES_TEXT, MAX_LINES_LONGTEXT )
MODULE_CONFIG_STOP
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