1 /*****************************************************************************
\r
2 * mainframe.cpp: Win32 interface plugin for vlc
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2002 VideoLAN
\r
6 * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
21 *****************************************************************************/
\r
26 #include <vlc/vlc.h>
\r
27 #include <vlc/intf.h>
\r
28 #include <vlc/vout.h>
\r
30 #include "dragdrop.h"
\r
31 #include "mainframe.h"
\r
34 #include "network.h"
\r
36 #include "preferences.h"
\r
37 #include "messages.h"
\r
38 #include "playlist.h"
\r
40 #include "win32_common.h"
\r
42 #include "netutils.h"
\r
44 //---------------------------------------------------------------------------
\r
45 #pragma link "CSPIN"
\r
46 #pragma resource "*.dfm"
\r
48 extern int Win32Manage( intf_thread_t *p_intf );
\r
50 //---------------------------------------------------------------------------
\r
51 __fastcall TMainFrameDlg::TMainFrameDlg(
\r
52 TComponent* Owner, intf_thread_t *_p_intf ) : TForm( Owner )
\r
56 Application->ShowHint = true;
\r
57 Application->OnHint = DisplayHint;
\r
59 TimerManage->Interval = INTF_IDLE_SLEEP / 1000;
\r
61 TrackBar->Max = SLIDER_MAX_VALUE;
\r
63 /* default height and caption */
\r
64 ClientHeight = 37 + ToolBar->Height;
\r
65 Caption = VOUT_TITLE " (Win32 interface)";
\r
67 StringListPref = new TStringList();
\r
71 /* drag and drop stuff */
\r
73 /* initialize the OLE library */
\r
74 OleInitialize( NULL );
\r
75 /* TDropTarget will send the WM_OLEDROP message to the form */
\r
76 lpDropTarget = (LPDROPTARGET)new TDropTarget( this->Handle );
\r
77 CoLockObjectExternal( lpDropTarget, true, true );
\r
78 /* register the form as a drop target */
\r
79 RegisterDragDrop( this->Handle, lpDropTarget );
\r
81 //---------------------------------------------------------------------------
\r
82 __fastcall TMainFrameDlg::~TMainFrameDlg()
\r
84 delete StringListPref;
\r
86 //---------------------------------------------------------------------------
\r
89 /*****************************************************************************
\r
91 ****************************************************************************/
\r
92 void __fastcall TMainFrameDlg::TimerManageTimer( TObject *Sender )
\r
94 Win32Manage( p_intf );
\r
96 //---------------------------------------------------------------------------
\r
97 void __fastcall TMainFrameDlg::DisplayHint( TObject *Sender )
\r
99 StatusBar->SimpleText = GetLongHint( Application->Hint );
\r
101 //---------------------------------------------------------------------------
\r
102 void __fastcall TMainFrameDlg::TrackBarChange( TObject *Sender )
\r
104 /* This function displays the current date related to the position in
\r
105 * the stream. It is called whenever the slider changes its value.
\r
106 * The lock has to be taken before the function is called */
\r
108 if( p_intf->p_sys->p_input != NULL )
\r
110 #define p_area p_intf->p_sys->p_input->stream.p_selected_area
\r
111 char psz_time[ OFFSETTOTIME_MAX_SIZE ];
\r
112 off_t Value = TrackBar->Position;
\r
114 GroupBoxSlider->Caption =
\r
115 input_OffsetToTime( p_intf->p_sys->p_input, psz_time,
\r
116 ( p_area->i_size * Value ) / (off_t)SLIDER_MAX_VALUE );
\r
120 //---------------------------------------------------------------------------
\r
121 void __fastcall TMainFrameDlg::FormClose( TObject *Sender,
\r
122 TCloseAction &Action )
\r
124 vlc_mutex_lock( &p_intf->change_lock );
\r
125 p_intf->p_vlc->b_die = VLC_TRUE;
\r
126 vlc_mutex_unlock( &p_intf->change_lock );
\r
128 /* remove the form from the list of drop targets */
\r
129 RevokeDragDrop( this->Handle );
\r
130 lpDropTarget->Release();
\r
131 CoLockObjectExternal( lpDropTarget, false, true );
\r
133 /* uninitialize the OLE library */
\r
136 /* we don't destroy the form immediatly */
\r
139 //---------------------------------------------------------------------------
\r
142 /*****************************************************************************
\r
144 ****************************************************************************/
\r
145 void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
\r
147 if( OpenDialog1->Execute() )
\r
149 /* add the new file to the interface playlist */
\r
150 for ( int i = 0 ; i < OpenDialog1->Files->Count ; i++ )
\r
151 p_intf->p_sys->p_playwin->Add( OpenDialog1->Files->Strings[i],
\r
153 | ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 ),
\r
157 //---------------------------------------------------------------------------
\r
158 void __fastcall TMainFrameDlg::OpenDiscActionExecute( TObject *Sender )
\r
160 TDiscDlg *p_disc = p_intf->p_sys->p_disc;
\r
161 if( p_disc == NULL )
\r
163 p_disc = new TDiscDlg( this, p_intf );
\r
164 p_intf->p_sys->p_disc = p_disc;
\r
168 //---------------------------------------------------------------------------
\r
169 void __fastcall TMainFrameDlg::NetworkStreamActionExecute( TObject *Sender )
\r
171 TNetworkDlg *p_network = p_intf->p_sys->p_network;
\r
172 if( p_network == NULL )
\r
174 p_network = new TNetworkDlg( this, p_intf );
\r
175 p_intf->p_sys->p_network = p_network;
\r
179 //---------------------------------------------------------------------------
\r
180 void __fastcall TMainFrameDlg::ExitActionExecute( TObject *Sender )
\r
184 //---------------------------------------------------------------------------
\r
185 void __fastcall TMainFrameDlg::FullscreenActionExecute( TObject *Sender )
\r
187 vout_thread_t *p_vout;
\r
189 p_vout = (vout_thread_t *)vlc_object_find( p_intf->p_sys->p_input,
\r
190 VLC_OBJECT_VOUT, FIND_CHILD );
\r
191 if( p_vout == NULL )
\r
196 p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
\r
197 vlc_object_release( p_vout );
\r
199 //---------------------------------------------------------------------------
\r
200 void __fastcall TMainFrameDlg::PlaylistActionExecute( TObject *Sender )
\r
202 TPlaylistDlg *p_playwin = p_intf->p_sys->p_playwin;
\r
203 if( p_playwin->Visible )
\r
209 p_playwin->UpdateGrid();
\r
213 //---------------------------------------------------------------------------
\r
214 void __fastcall TMainFrameDlg::MessagesActionExecute( TObject *Sender )
\r
216 p_intf->p_sys->p_messages->Show();
\r
218 //---------------------------------------------------------------------------
\r
219 void __fastcall TMainFrameDlg::PreferencesActionExecute( TObject *Sender )
\r
221 CreatePreferences( "main" );
\r
223 //---------------------------------------------------------------------------
\r
224 void __fastcall TMainFrameDlg::AboutActionExecute( TObject *Sender )
\r
226 TAboutDlg *AboutDlg = new TAboutDlg( this, p_intf );
\r
227 AboutDlg->ShowModal();
\r
230 //---------------------------------------------------------------------------
\r
231 void __fastcall TMainFrameDlg::BackActionExecute( TObject *Sender )
\r
235 //---------------------------------------------------------------------------
\r
236 void __fastcall TMainFrameDlg::PlayActionExecute( TObject *Sender )
\r
238 p_intf->p_sys->p_playwin->Play();
\r
240 //---------------------------------------------------------------------------
\r
241 void __fastcall TMainFrameDlg::PauseActionExecute( TObject *Sender )
\r
243 p_intf->p_sys->p_playwin->Pause();
\r
245 //---------------------------------------------------------------------------
\r
246 void __fastcall TMainFrameDlg::StopActionExecute( TObject *Sender )
\r
248 p_intf->p_sys->p_playwin->Stop();
\r
250 //---------------------------------------------------------------------------
\r
251 void __fastcall TMainFrameDlg::SlowActionExecute( TObject *Sender )
\r
253 p_intf->p_sys->p_playwin->Slow();
\r
255 //---------------------------------------------------------------------------
\r
256 void __fastcall TMainFrameDlg::FastActionExecute( TObject *Sender )
\r
258 p_intf->p_sys->p_playwin->Fast();
\r
260 //---------------------------------------------------------------------------
\r
261 void __fastcall TMainFrameDlg::PreviousActionExecute(TObject *Sender)
\r
263 p_intf->p_sys->p_playwin->Previous();
\r
265 //---------------------------------------------------------------------------
\r
266 void __fastcall TMainFrameDlg::NextActionExecute(TObject *Sender)
\r
268 p_intf->p_sys->p_playwin->Next();
\r
270 //---------------------------------------------------------------------------
\r
271 void __fastcall TMainFrameDlg::EjectActionExecute( TObject *Sender )
\r
273 AnsiString Device = "";
\r
274 char * psz_current;
\r
275 playlist_t * p_playlist;
\r
277 p_playlist = (playlist_t *)vlc_object_find( p_intf,
\r
278 VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
\r
279 if( p_playlist == NULL )
\r
285 * Get the active input
\r
286 * Determine whether we can eject a media, ie it's a VCD or DVD
\r
287 * If it's neither a VCD nor a DVD, then return
\r
290 vlc_mutex_lock( &p_playlist->object_lock );
\r
291 psz_current = p_playlist->pp_items[ p_playlist->i_index ]->psz_name;
\r
293 if( psz_current != NULL )
\r
295 if( strncmp( psz_current, "dvd", 3 )
\r
296 || strncmp( psz_current, "vcd", 3 ) )
\r
298 /* Determine the device name by omitting the first 4 characters
\r
299 * and keeping 3 characters */
\r
300 Device = strdup( ( psz_current + 4 ) );
\r
301 Device = Device.SubString( 1, 2 );
\r
305 vlc_mutex_unlock( &p_playlist->object_lock );
\r
306 vlc_object_release( p_playlist );
\r
313 /* If there's a stream playing, we aren't allowed to eject ! */
\r
314 if( p_intf->p_sys->p_input == NULL )
\r
316 msg_Dbg( p_intf, "ejecting %s", Device.c_str() );
\r
318 intf_Eject( p_intf, Device.c_str() );
\r
321 //--------------------------------------------------------------------------
\r
322 void __fastcall TMainFrameDlg::VolumeUpActionExecute( TObject *Sender )
\r
324 aout_instance_t *p_aout;
\r
325 p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
\r
327 if ( p_aout != NULL )
\r
329 aout_VolumeUp( p_aout, 1, NULL );
\r
330 vlc_object_release( (vlc_object_t *)p_aout );
\r
333 //---------------------------------------------------------------------------
\r
334 void __fastcall TMainFrameDlg::VolumeDownActionExecute( TObject *Sender )
\r
336 aout_instance_t *p_aout;
\r
337 p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
\r
339 if ( p_aout != NULL )
\r
341 aout_VolumeDown( p_aout, 1, NULL );
\r
342 vlc_object_release( (vlc_object_t *)p_aout );
\r
345 //---------------------------------------------------------------------------
\r
346 void __fastcall TMainFrameDlg::MuteActionExecute( TObject *Sender )
\r
348 aout_instance_t *p_aout;
\r
349 p_aout = (aout_instance_t *)vlc_object_find( p_intf, VLC_OBJECT_AOUT,
\r
351 if ( p_aout != NULL )
\r
353 aout_VolumeMute( p_aout, NULL );
\r
354 vlc_object_release( (vlc_object_t *)p_aout );
\r
356 // MenuMute->Checked = ! MenuMute->Checked;
\r
359 //---------------------------------------------------------------------------
\r
362 /*****************************************************************************
\r
363 * External drop handling
\r
364 *****************************************************************************/
\r
365 void __fastcall TMainFrameDlg::OnDrop( TMessage &Msg )
\r
367 /* find the number of files dropped */
\r
368 int num_files = DragQueryFile( (HDROP)Msg.WParam, 0xFFFFFFFF,
\r
369 (LPSTR)NULL, NULL );
\r
371 /* append each file to the playlist */
\r
372 for( int i = 0; i < num_files; i++ )
\r
374 /* find the length of the filename */
\r
375 int name_length = DragQueryFile( (HDROP)Msg.WParam, i, NULL, NULL ) + 1;
\r
377 /* get the filename */
\r
378 char *FileName = new char[name_length];
\r
379 DragQueryFile( (HDROP)Msg.WParam, i, FileName, name_length );
\r
381 /* add the new file to the playlist */
\r
382 p_intf->p_sys->p_playwin->Add( FileName, PLAYLIST_APPEND | PLAYLIST_GO,
\r
388 DragFinish( (HDROP)Msg.WParam );
\r
391 //--------------------------------------------------------------------------
\r
394 /*****************************************************************************
\r
395 * Menu and popup callbacks
\r
396 *****************************************************************************/
\r
397 void __fastcall TMainFrameDlg::MenuHideinterfaceClick( TObject *Sender )
\r
399 this->SendToBack();
\r
401 //---------------------------------------------------------------------------
\r
402 void __fastcall TMainFrameDlg::PopupToggleInterfaceClick( TObject *Sender )
\r
404 this->BringToFront();
\r
406 //---------------------------------------------------------------------------
\r
407 void __fastcall TMainFrameDlg::PopupCloseClick( TObject *Sender )
\r
409 /* We do nothing, we just need a click on a menu item
\r
410 * to close the popup. Don't ask me why... */
\r
413 //---------------------------------------------------------------------------
\r
414 void __fastcall TMainFrameDlg::PopupJumpClick( TObject *Sender )
\r
418 //---------------------------------------------------------------------------
\r
421 /*****************************************************************************
\r
422 * Callbacks for DVD/VCD navigation
\r
423 ****************************************************************************/
\r
424 void __fastcall TMainFrameDlg::PrevTitleActionExecute( TObject *Sender )
\r
426 input_area_t * p_area;
\r
429 i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id - 1;
\r
431 /* Disallow area 0 since it is used for video_ts.vob */
\r
434 p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
\r
435 input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
\r
437 input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
\r
439 p_intf->p_sys->b_title_update = 1;
\r
440 vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
441 p_intf->p_sys->p_menus->SetupMenus();
\r
442 vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
445 //---------------------------------------------------------------------------
\r
446 void __fastcall TMainFrameDlg::NextTitleActionExecute( TObject *Sender )
\r
448 input_area_t * p_area;
\r
451 i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id + 1;
\r
453 if( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
\r
455 p_area = p_intf->p_sys->p_input->stream.pp_areas[i_id];
\r
456 input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
\r
458 input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
\r
460 p_intf->p_sys->b_title_update = 1;
\r
461 vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
462 p_intf->p_sys->p_menus->SetupMenus();
\r
463 vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
466 //---------------------------------------------------------------------------
\r
467 void __fastcall TMainFrameDlg::PrevChapterActionExecute( TObject *Sender )
\r
469 input_area_t * p_area;
\r
471 p_area = p_intf->p_sys->p_input->stream.p_selected_area;
\r
473 if( p_area->i_part > 0 )
\r
476 input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
\r
478 input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
\r
480 p_intf->p_sys->b_chapter_update = 1;
\r
481 vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
482 p_intf->p_sys->p_menus->SetupMenus();
\r
483 vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
486 //---------------------------------------------------------------------------
\r
487 void __fastcall TMainFrameDlg::NextChapterActionExecute( TObject *Sender )
\r
489 input_area_t * p_area;
\r
491 p_area = p_intf->p_sys->p_input->stream.p_selected_area;
\r
493 if( p_area->i_part < p_area->i_part_nb )
\r
496 input_ChangeArea( p_intf->p_sys->p_input, (input_area_t*)p_area );
\r
498 input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
\r
500 p_intf->p_sys->b_chapter_update = 1;
\r
501 vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
502 p_intf->p_sys->p_menus->SetupMenus();
\r
503 vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
\r
506 //---------------------------------------------------------------------------
\r
509 /*****************************************************************************
\r
510 * Callback for the 'go!' button
\r
511 ****************************************************************************/
\r
512 void __fastcall TMainFrameDlg::ButtonGoClick( TObject *Sender )
\r
516 i_channel = SpinEditChannel->Value;
\r
517 msg_Dbg( p_intf, "joining channel %d", i_channel );
\r
519 vlc_mutex_lock( &p_intf->change_lock );
\r
520 network_ChannelJoin( p_intf, i_channel );
\r
521 vlc_mutex_unlock( &p_intf->change_lock );
\r
523 // input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
\r
525 //---------------------------------------------------------------------------
\r
528 /*****************************************************************************
\r
529 * ModeManage: actualise the aspect of the interface whenever the input
\r
531 *****************************************************************************
\r
532 * The lock has to be taken before you call the function.
\r
533 *****************************************************************************/
\r
534 void __fastcall TMainFrameDlg::ModeManage()
\r
536 TGroupBox * ActiveGB;
\r
540 /* hide all boxes */
\r
541 GroupBoxFile->Visible = false;
\r
542 GroupBoxNetwork->Visible = false;
\r
543 GroupBoxDisc->Visible = false;
\r
546 GroupBoxSlider->Hide();
\r
548 /* controls unavailable */
\r
551 /* show the box related to current input mode */
\r
552 if( p_intf->p_sys->p_input != NULL )
\r
554 switch( p_intf->p_sys->p_input->stream.i_method & 0xf0 )
\r
556 case INPUT_METHOD_FILE:
\r
557 GroupBoxFile->Visible = true;
\r
558 ActiveGB = GroupBoxFile;
\r
559 LabelFileName->Caption = p_intf->p_sys->p_input->psz_source;
\r
561 case INPUT_METHOD_DISC:
\r
562 GroupBoxDisc->Visible = true;
\r
563 ActiveGB = GroupBoxDisc;
\r
565 case INPUT_METHOD_NETWORK:
\r
566 GroupBoxNetwork->Visible = true;
\r
567 ActiveGB = GroupBoxNetwork;
\r
568 LabelServer->Caption = p_intf->p_sys->p_input->psz_source;
\r
569 if( config_GetInt( p_intf, "network-channel" ) )
\r
571 LabelChannel->Visible = true;
\r
575 LabelChannel->Visible = false;
\r
579 msg_Warn( p_intf, "cannot determine input method" );
\r
580 GroupBoxFile->Visible = true;
\r
581 ActiveGB = GroupBoxFile;
\r
582 LabelFileName->Caption = p_intf->p_sys->p_input->psz_source;
\r
586 i_Height = StatusBar->Height + ActiveGB->Height + ToolBar->Height + 54;
\r
588 /* initialize and show slider for seekable streams */
\r
589 if( p_intf->p_sys->p_input->stream.b_seekable )
\r
591 TrackBar->Position = p_intf->p_sys->OldValue = 0;
\r
592 GroupBoxSlider->Show();
\r
593 i_Height += GroupBoxSlider->Height;
\r
596 /* control buttons for free pace streams */
\r
597 b_control = p_intf->p_sys->p_input->stream.b_pace_control;
\r
599 /* get ready for menu regeneration */
\r
600 p_intf->p_sys->b_program_update = 1;
\r
601 p_intf->p_sys->b_title_update = 1;
\r
602 p_intf->p_sys->b_chapter_update = 1;
\r
603 p_intf->p_sys->b_audio_update = 1;
\r
604 p_intf->p_sys->b_spu_update = 1;
\r
605 p_intf->p_sys->i_part = 0;
\r
607 p_intf->p_sys->p_input->stream.b_changed = 0;
\r
608 msg_Dbg( p_intf, "stream has changed, refreshing interface" );
\r
612 i_Height = StatusBar->Height + ToolBar->Height + 47;
\r
614 if( config_GetInt( p_intf, "network-channel" ) )
\r
616 GroupBoxNetwork->Visible = true;
\r
617 LabelChannel->Visible = true;
\r
618 i_Height += GroupBoxNetwork->Height + 7;
\r
622 /* add space between tolbar and statusbar when
\r
623 * nothing is displayed; isn't it nicer ? :) */
\r
627 /* unsensitize menus */
\r
628 MenuProgram->Enabled = false;
\r
629 MenuTitle->Enabled = false;
\r
630 MenuChapter->Enabled = false;
\r
631 MenuLanguage->Enabled = false;
\r
632 MenuSubtitles->Enabled = false;
\r
633 PopupNavigation->Enabled = false;
\r
634 PopupLanguage->Enabled = false;
\r
635 PopupSubtitles->Enabled = false;
\r
638 /* resize main window */
\r
639 this->Height = i_Height;
\r
641 /* set control items */
\r
642 ToolButtonBack->Enabled = false;
\r
643 ToolButtonEject->Enabled = !b_control;
\r
644 StopAction->Enabled = true;
\r
645 PauseAction->Enabled = b_control;
\r
646 SlowAction->Enabled = b_control;
\r
647 FastAction->Enabled = b_control;
\r
648 PopupBack->Enabled = false;
\r
650 //---------------------------------------------------------------------------
\r
653 /*****************************************************************************
\r
654 * CreateConfig: create a configuration dialog and save it for further use
\r
655 *****************************************************************************
\r
656 * Check if the dialog box is already opened, if so this will save us
\r
657 * quite a bit of work. (the interface will be destroyed when you actually
\r
658 * close the main window, but remember that it is only hidden if you
\r
659 * clicked on the action buttons). This trick also allows us not to
\r
660 * duplicate identical dialog windows.
\r
661 *****************************************************************************/
\r
662 void __fastcall TMainFrameDlg::CreatePreferences( AnsiString Name )
\r
664 TPreferencesDlg *Preferences;
\r
665 int i_index, i_pos;
\r
667 i_index = StringListPref->IndexOf( Name );
\r
668 if( i_index != -1 )
\r
670 /* config dialog already exists */
\r
671 Preferences = (TPreferencesDlg *)StringListPref->Objects[i_index];
\r
675 /* create the config dialog */
\r
676 Preferences = new TPreferencesDlg( this, p_intf );
\r
677 Preferences->CreateConfigDialog( Name.c_str() );
\r
680 i_pos = StringListPref->Add( Name );
\r
681 StringListPref->Objects[i_pos] = Preferences;
\r
684 /* display the dialog */
\r
685 Preferences->Show();
\r
687 //---------------------------------------------------------------------------
\r