// Licence:
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
- #pragma implementation "configtoolview.h"
-#endif
-
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#endif
#include "wx/wfstream.h"
+#include "wx/txtstrm.h"
#include "configtoolview.h"
#include "configtooldoc.h"
#include "configtree.h"
{
if (!item->GetParent())
{
- item->SetTreeItem(treeControl->AddRoot(_(""), -1, -1, new ctTreeItemData(item)));
+ item->SetTreeItem(treeControl->AddRoot(wxEmptyString, -1, -1, new ctTreeItemData(item)));
}
else
{
ctConfigItem* sel = GetSelection();
if (sel)
{
- wxString name = wxGetTextFromUser(_("Please enter a name for the new item."),
- msg, wxT(""));
- if (!name.IsEmpty())
+ wxString name = wxGetTextFromUser(_("Please enter a name for the new item."), msg);
+ if (!name.empty())
{
ctConfigItem* parent ;
ctConfigItem* insertBefore ;
{
wxString name = wxGetTextFromUser(_("Please enter a new name for the item."),
_("Rename item"), sel->GetName());
- if (!name.IsEmpty())
+ if (!name.empty())
{
sel->SetName(name);
SyncItem(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), sel);
if ( doc && GetSelection() )
{
wxString helpTopic = GetSelection()->GetPropertyString(wxT("help-topic"));
- if (!helpTopic.IsEmpty())
+ if (!helpTopic.empty())
{
wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic);
}
else if (type == wxT("long"))
property->GetVariant() = wxVariant((long) 0, name);
else
- property->GetVariant() = wxVariant(wxT(""), name);
+ property->GetVariant() = wxVariant(wxEmptyString, name);
property->SetCustom(true);
property->SetDescription(descr);
property->SetChoices(choices);
else if (type == wxT("long"))
property->GetVariant() = wxVariant((long) 0, name);
else
- property->GetVariant() = wxVariant(wxT(""), name);
+ property->GetVariant() = wxVariant(wxEmptyString, name);
}
if (name != oldName)
property->GetVariant().SetName(name);
wxString filename = _T("setup.h");
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
- if (path.IsEmpty())
+ if (path.empty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Setup File As"),
path, filename ,
- wildcard, wxSAVE|wxOVERWRITE_PROMPT);
+ wildcard, wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
wxGetApp().GetSettings().m_lastSetupSaveDir = wxPathOnly(fullPath);
- wxFileOutputStream stream(fullPath);
- if (!stream.Ok())
+ wxFileOutputStream osFile(fullPath);
+ if (!osFile.Ok())
{
wxMessageBox(_("Sorry, could not save this file."), _("Save Setup File"), wxICON_EXCLAMATION|wxOK);
return;
}
+ wxTextOutputStream stream(osFile);
stream << setupStr;
}
}
wxString filename = _T("configurewx.sh");
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
- if (path.IsEmpty())
+ if (path.empty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
wxFileDialog dialog(wxTheApp->GetTopWindow(),
_("Save Configure Command File As"),
path, filename ,
- wildcard, wxSAVE|wxOVERWRITE_PROMPT);
+ wildcard, wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dialog.ShowModal() == wxID_OK)
{
wxString fullPath = dialog.GetPath();
wxGetApp().GetSettings().m_lastSetupSaveDir = wxPathOnly(fullPath);
- wxFileOutputStream stream(fullPath);
- if (!stream.Ok())
+ wxFileOutputStream osFile(fullPath);
+ if (!osFile.Ok())
{
wxMessageBox(_("Sorry, could not save this file."), _("Save Configure Command File"), wxICON_EXCLAMATION|wxOK);
return;
}
+ wxTextOutputStream stream(osFile);
stream << configureStr;
}
}
{
ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument();
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
- if (!path.IsEmpty())
+ if (!path.empty())
{
if (wxGetApp().GetSettings().m_defaultFileKind == wxT("Setup file"))
{
void ctConfigToolView::OnUpdateGo(wxUpdateUIEvent& event)
{
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
- event.Enable(!path.IsEmpty());
+ event.Enable(!path.empty());
}
//----------------------------------------------------------------------------
return false;
}
- if (!sm_currentItem.IsEmpty())
+ if (!sm_currentItem.empty())
{
currentItem = doc->GetTopItem()->FindItem(sm_currentItem);
}