mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Tabs visibility when no language is found
This commit is contained in:
parent
51c3ece9b3
commit
d2a59fe2f3
2 changed files with 25 additions and 34 deletions
|
@ -563,6 +563,12 @@ public class LanguageSettingsEntriesTab extends AbstractCPropertyTab {
|
||||||
status = new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, msg);
|
status = new Status(IStatus.INFO, CUIPlugin.PLUGIN_ID, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (status==null || status==Status.OK_STATUS) {
|
||||||
|
if (treeLanguages.getItemCount()<=0) {
|
||||||
|
String msg = "Cannot determine toolchain languages.";
|
||||||
|
status = new Status(IStatus.ERROR, CUIPlugin.PLUGIN_ID, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
fStatusLine.setErrorStatus(status);
|
fStatusLine.setErrorStatus(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1080,24 +1086,28 @@ providers: for (ILanguageSettingsProvider provider : providers) {
|
||||||
public boolean canBeVisible() {
|
public boolean canBeVisible() {
|
||||||
if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS))
|
if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS))
|
||||||
return false;
|
return false;
|
||||||
if (page.isForPrefs())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
ICLanguageSetting [] langSettings = getLangSettings(getResDesc());
|
//filter out files not associated with any languages
|
||||||
if (langSettings == null)
|
if (page.isForFile()) {
|
||||||
return false;
|
ICLanguageSetting [] langSettings = getLangSettings(getResDesc());
|
||||||
|
if (langSettings == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
for (ICLanguageSetting langSetting : langSettings) {
|
// files like *.o may have langSettings but no associated language
|
||||||
String langId = langSetting.getLanguageId();
|
for (ICLanguageSetting langSetting : langSettings) {
|
||||||
if (langId!=null && langId.length()>0) {
|
String langId = langSetting.getLanguageId();
|
||||||
LanguageManager langManager = LanguageManager.getInstance();
|
if (langId!=null && langId.length()>0) {
|
||||||
ILanguageDescriptor langDes = langManager.getLanguageDescriptor(langId);
|
LanguageManager langManager = LanguageManager.getInstance();
|
||||||
if (langDes != null)
|
ILanguageDescriptor langDes = langManager.getLanguageDescriptor(langId);
|
||||||
return true;
|
if (langDes != null)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1012,27 +1012,8 @@ public class LanguageSettingsProviderTab extends AbstractCPropertyTab {
|
||||||
public boolean canBeVisible() {
|
public boolean canBeVisible() {
|
||||||
if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS))
|
if (CDTPrefUtil.getBool(CDTPrefUtil.KEY_NO_SHOW_PROVIDERS))
|
||||||
return false;
|
return false;
|
||||||
if (page.isForPrefs())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (!page.isForProject())
|
return page.isForPrefs() || page.isForProject();
|
||||||
return false;
|
|
||||||
|
|
||||||
ICLanguageSetting [] langSettings = getLangSettings(getResDesc());
|
|
||||||
if (langSettings == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for (ICLanguageSetting langSetting : langSettings) {
|
|
||||||
String langId = langSetting.getLanguageId();
|
|
||||||
if (langId!=null && langId.length()>0) {
|
|
||||||
LanguageManager langManager = LanguageManager.getInstance();
|
|
||||||
ILanguageDescriptor langDes = langManager.getLanguageDescriptor(langId);
|
|
||||||
if (langDes != null)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue