\r
/* default height */\r
ClientHeight = 37 + ToolBar->Height;\r
+\r
+ StringListPref = new TStringList();\r
+}\r
+//---------------------------------------------------------------------------\r
+__fastcall TMainFrameDlg::~TMainFrameDlg()\r
+{\r
+ delete StringListPref;\r
}\r
//---------------------------------------------------------------------------\r
\r
//---------------------------------------------------------------------------\r
void __fastcall TMainFrameDlg::MenuPreferencesClick( TObject *Sender )\r
{\r
- TPreferencesDlg *p_preferences = p_intfGlobal->p_sys->p_preferences;\r
- if( p_preferences == NULL )\r
- {\r
- p_preferences = new TPreferencesDlg( this );\r
- p_preferences->CreateConfigDialog( "main" );\r
- p_intfGlobal->p_sys->p_preferences = p_preferences;\r
- }\r
- else\r
- {\r
- p_preferences->Show();\r
- }\r
+ CreatePreferences( "main" );\r
}\r
//---------------------------------------------------------------------------\r
void __fastcall TMainFrameDlg::MenuAboutClick( TObject *Sender )\r
p_intfGlobal->p_sys->p_playlist->Next();\r
}\r
//---------------------------------------------------------------------------\r
-void __fastcall TMainFrameDlg::ToolButtonEjecttempClick( TObject *Sender )\r
+void __fastcall TMainFrameDlg::ToolButtonEjectClick( TObject *Sender )\r
{\r
AnsiString Device = "";\r
\r
GroupBoxNetwork->Visible = true;\r
ActiveGB = GroupBoxNetwork;\r
LabelServer->Caption = p_input_bank->pp_input[0]->psz_source;\r
- if( config_GetIntVariable( "network_channel" ) )\r
+ if( config_GetIntVariable( "network-channel" ) )\r
{\r
LabelChannel->Visible = true;\r
}\r
i_Height += GroupBoxSlider->Height;\r
}\r
\r
- /* resize main window */\r
- this->Height = i_Height;\r
-\r
/* control buttons for free pace streams */\r
b_control = p_input_bank->pp_input[0]->stream.b_pace_control;\r
\r
}\r
else\r
{\r
- if( config_GetIntVariable( "network_channel" ) )\r
+ i_Height = StatusBar->Height + ToolBar->Height + 47;\r
+\r
+ if( config_GetIntVariable( "network-channel" ) )\r
{\r
GroupBoxNetwork->Visible = true;\r
LabelChannel->Visible = true;\r
+ i_Height += GroupBoxNetwork->Height;\r
}\r
else\r
{\r
- /* default mode */\r
- ClientHeight = 37 + ToolBar->Height;\r
-\r
/* unsensitize menus */\r
MenuProgram->Enabled = false;\r
MenuTitle->Enabled = false;\r
}\r
}\r
\r
+ /* resize main window */\r
+ this->Height = i_Height;\r
+\r
/* set control items */\r
ToolButtonBack->Enabled = false;\r
ToolButtonStop->Enabled = true;\r
PopupSlow->Enabled = b_control;\r
PopupFast->Enabled = b_control;\r
}\r
+//---------------------------------------------------------------------------\r
+\r
+\r
+/*****************************************************************************\r
+ * CreateConfig: create a configuration dialog and save it for further use\r
+ *****************************************************************************\r
+ * Check if the dialog box is already opened, if so this will save us\r
+ * quite a bit of work. (the interface will be destroyed when you actually\r
+ * close the main window, but remember that it is only hidden if you\r
+ * clicked on the action buttons). This trick also allows us not to\r
+ * duplicate identical dialog windows.\r
+ *****************************************************************************/\r
+void __fastcall TMainFrameDlg::CreatePreferences( AnsiString Name )\r
+{\r
+ TPreferencesDlg *Preferences;\r
+ int i_index, i_pos;\r
+\r
+ i_index = StringListPref->IndexOf( Name );\r
+ if( i_index != -1 )\r
+ {\r
+ /* config dialog already exists */\r
+ Preferences = (TPreferencesDlg *)StringListPref->Objects[i_index];\r
+ }\r
+ else\r
+ {\r
+ /* create the config dialog */\r
+ Preferences = new TPreferencesDlg( this );\r
+ Preferences->CreateConfigDialog( Name.c_str() );\r
+\r
+ /* save it */\r
+ i_pos = StringListPref->Add( Name );\r
+ StringListPref->Objects[i_pos] = Preferences;\r
+ }\r
+\r
+ /* display the dialog */\r
+ Preferences->Show();\r
+}\r
+//---------------------------------------------------------------------------\r
\r