42 initialInfo <<
_T(
"<html><body><font color=\"#0000AA\">");
43 initialInfo <<
_(
"Tip: The above list allows for multiple selections.");
44 initialInfo << _T(
"</font><br /><br /><b><font color=\"red\">");
45 initialInfo <<
_(
"Have you saved your work first?");
46 initialInfo << _T(
"</font></b><br /><i><font color=\"black\">\n");
47 initialInfo <<
_(
"If a plugin is not well-written, it could cause Code::Blocks to crash ");
48 initialInfo <<
_(
"when performing any operation on it...");
49 initialInfo << _T(
"<br></font></b><br /><i><font color=\"green\">\n");
50 initialInfo <<
_(
"Some additional plugins can be found here:");
51 initialInfo << _T(
"</font></b><br /><i><font color=\"black\">\n");
52 initialInfo << _T(
"<A href=\"http://wiki.codeblocks.org/index.php?title=Announcement_for_plugins/patches\">");
53 initialInfo << _T(
"http://wiki.codeblocks.org/index.php?title=Announcement_for_plugins/patches\n </A>");
57 initialInfo << _T(
"</font></i><br /><br /><b><font color=\"red\">");
58 initialInfo <<
_(
"Code::Blocks started up in \"safe-mode\"");
59 initialInfo << _T(
"</font></b><br /><i><font color=\"black\">\n");
60 initialInfo <<
_(
"All plugins were disabled on startup so that you can troubleshoot ");
61 initialInfo <<
_(
"problematic plugins. Enable plugins at will now...");
64 initialInfo << _T(
"</font></i><br /></body></html>\n");
68 #if wxCHECK_VERSION(3, 0, 0) 71 inline int wxCALLBACK
sortByTitle(
long item1,
long item2, cb_unused
long sortData)
96 XRCCTRL(*
this,
"wxID_CANCEL",
wxButton)->SetDefault();
101 bool globalInstall = cfg->
ReadBool(
_T(
"/install_globally"),
true);
102 bool confirmation = cfg->
ReadBool(
_T(
"/install_confirmation"),
true);
108 globalInstall =
false;
110 XRCCTRL(*
this,
"chkInstallGlobally",
wxCheckBox)->Enable(
false);
112 XRCCTRL(*
this,
"chkInstallGlobally",
wxCheckBox)->SetValue(globalInstall);
113 XRCCTRL(*
this,
"chkInstallConfirmation",
wxCheckBox)->SetValue(confirmation);
124 for (
int i = 0; i < 7; ++i)
147 const PluginElementsArray& plugins = man->
GetPlugins();
151 for (
unsigned int i = 0; i < plugins.GetCount(); ++i)
161 if (!elem->plugin->IsAttached())
187 bool isEnable =
event.GetId() == XRCID(
"btnEnable");
192 _T(
"A description wide enough for the dialog ;)"),
245 _(
"Select plugin to install"),
247 _T(
"Code::Blocks Plugins (*.cbplugin)|*.cbplugin"),
258 bool globalInstall = XRCCTRL(*
this,
"chkInstallGlobally",
wxCheckBox)->GetValue();
259 bool confirm = XRCCTRL(*
this,
"chkInstallConfirmation",
wxCheckBox)->GetValue();
262 for (
size_t i = 0; i < paths.
GetCount(); ++i)
265 failure << paths[i] <<
_T(
'\n');
314 cfg->
Write(
_T(
"/last_export_path"), dd.GetPath());
318 _T(
"A description wide enough for the dialog ;)"),
327 bool confirmed =
false;
337 if (!elem || !elem->
plugin)
377 "Are you sure you want to overwrite it?"), filename.
c_str()),
381 _(
"&Yes"),
_(
"Yes to &all"),
_(
"&No"));
382 switch (dlg.ShowModal())
420 info <<
_T(
"<html><body>\n");
421 info << _T(
"<h3>") << elem->
info.
title << _T(
" ");
422 info << _T(
"<font color=\"#0000AA\">") << elem->
info.
version << _T(
"</font></h3>");
423 info << _T(
"<i><font color=\"#808080\" size=\"-1\">") <<
UnixFilename(elem->
fileName) << _T(
"</font></i><br />\n");
424 info << _T(
"<br />\n");
425 info << description << _T(
"<br />\n");
426 info << _T(
"</body></html>\n");
428 XRCCTRL(*
this,
"htmlInfo",
wxHtmlWindow)->SetPage(info);
437 if (list->GetToolTip())
438 list->UnsetToolTip();
450 if (list->GetToolTip())
453 list->UnsetToolTip();
454 else if (path != list->GetToolTip()->GetTip())
455 list->SetToolTip(path);
458 list->SetToolTip(path);
463 static long lastSelection = -2;
464 static bool lastSelectionMultiple =
false;
478 bool hasPlugin = elem && elem->
plugin;
481 XRCCTRL(*
this,
"btnEnable",
wxButton)->Enable(en && (lastSelectionMultiple || (hasPlugin && !isAttached)));
482 XRCCTRL(*
this,
"btnDisable",
wxButton)->Enable(en && (lastSelectionMultiple || (hasPlugin && isAttached)));
483 XRCCTRL(*
this,
"btnUninstall",
wxButton)->Enable(en);
484 XRCCTRL(*
this,
"btnExport",
wxButton)->Enable(en);
491 cfg->
Write(
_T(
"/install_globally"), XRCCTRL(*
this,
"chkInstallGlobally",
wxCheckBox)->GetValue());
492 cfg->
Write(
_T(
"/install_confirmation"), XRCCTRL(*
this,
"chkInstallConfirmation",
wxCheckBox)->GetValue());
static bool GetSafeMode()
wxString AfterLast(wxUniChar ch) const
void EndModal(int retCode)
#define wxLIST_HITTEST_ONITEM
static wxString GetFolder(SearchDirs dir)
Access one of Code::Blocks' folders.
PluginManager * GetPluginManager() const
int GetSelectedItemCount() const
ConfigManager * GetConfigManager(const wxString &name_space) const
Current user has read-write access to the directory.
static wxFont GetFont(wxSystemFont index)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
long GetNextItem(long item, int geometry=wxLIST_NEXT_ALL, int state=wxLIST_STATE_DONTCARE) const
Dialog for Enabling/Disabling/Installing/Uninstalling a plug-in.
void OnMouseMotion(wxMouseEvent &event)
bool wxFileExists(const wxString &filename)
void NotifyPluginStatus()
Let CCManager know that a change (e.g.
bool ReadBool(const wxString &name, bool defaultVal=false)
int Index(const wxString &sz, bool bCase=true, bool bFromEnd=false) const
const PluginElementsArray & GetPlugins() const
#define wxLIST_STATE_SELECTED
#define wxPD_ESTIMATED_TIME
bool ExportPlugin(cbPlugin *plugin, const wxString &filename)
void OnUninstall(wxCommandEvent &event)
void SetPath(const wxString &path, wxPathFormat format=wxPATH_NATIVE)
DLLIMPORT DirAccessCheck cbDirAccessCheck(const wxString &dir)
Check what access the current user has in a directory.
wxPoint GetPosition() const
wxEventType wxEVT_LEAVE_WINDOW
int wxCALLBACK sortByTitle(wxIntPtr item1, wxIntPtr item2, cb_unused wxIntPtr sortData)
PluginManager manages plugins.
long InsertItem(wxListItem &info)
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
bool DetachPlugin(cbPlugin *plugin)
DLLIMPORT wxString UnixFilename(const wxString &filename, wxPathFormat format=wxPATH_NATIVE)
bool SetItemData(long item, long data)
#define wxDD_NEW_DIR_BUTTON
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
CCManager * GetCCManager() const
void SetItemTextColour(long item, const wxColour &col)
DirAccessCheck
Result values of cbDirAccessCheck()
~PluginsConfigurationDlg() override
static wxColour GetColour(wxSystemColour index)
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
void OnSelect(wxListEvent &event)
void EndModal(int retCode) override
const wxStringCharType * wx_str() const
void OnToggle(wxCommandEvent &event)
wxString GetItemText(long item, int col=0) const
const wxString & _(const wxString &string)
void OnLinkClicked(wxHtmlLinkEvent &event)
bool SortItems(wxListCtrlCompare fnSortCallBack, wxIntPtr data)
Plugins folder in base dir.
#define wxPD_ELAPSED_TIME
bool AttachPlugin(cbPlugin *plugin, bool ignoreSafeMode=false)
void OnInstall(wxCommandEvent &event)
int GetColumnCount() const
virtual void GetPaths(wxArrayString &paths) const
void OnExport(wxCommandEvent &event)
wxUIntPtr GetItemData(long item) const
long InsertColumn(long col, const wxListItem &info)
void SetExt(const wxString &ext)
virtual int GetPointSize() const
size_t Add(const wxString &str, size_t copies=1)
bool InstallPlugin(const wxString &pluginName, bool forAllUsers=true, bool askForConfirmation=true)
static wxString GetInitialInfo()
bool SetItem(wxListItem &info)
bool SetColumnWidth(int col, int width)
long HitTest(const wxPoint &point, int &flags, long *ptrSubItem=NULL) const
static wxXmlResource * Get()
bool IsAttached() const
See whether this plugin is attached or not.
bool wxLaunchDefaultBrowser(const wxString &url, int flags=0)
#define wxPD_REMAINING_TIME
void SetName(const wxString &name)
wxString GetFullPath(wxPathFormat format=wxPATH_NATIVE) const
void OnUpdateUI(wxUpdateUIEvent &event)
static wxString Format(const wxString &format,...)
wxObject * LoadObject(wxWindow *parent, const wxString &name, const wxString &classname)
Dialog that contains a "Don't annoy me" checkbox.
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
bool GetItem(wxListItem &info) const