added disable option to each core plugin

This commit is contained in:
Sebastian Sdorra
2012-02-11 16:18:46 +01:00
parent 46c41b4ae4
commit f0364e1520
7 changed files with 80 additions and 12 deletions

View File

@@ -275,15 +275,15 @@ public abstract class AbstractRepositoryHandler<C extends SimpleRepositoryConfig
}
/**
* Method description
* Returns true if the plugin is configured and enabled.
*
*
* @return
* @return true if the plugin is configured and enabled
*/
@Override
public boolean isConfigured()
{
return (config != null) && config.isValid();
return (config != null) && config.isValid() &&!config.isDisabled();
}
//~--- set methods ----------------------------------------------------------

View File

@@ -63,6 +63,18 @@ public class SimpleRepositoryConfig implements Validateable
return repositoryDirectory;
}
/**
* Returns true if the plugin is disabled.
*
*
* @return true if the plugin is disabled
* @since 1.13
*/
public boolean isDisabled()
{
return disabled;
}
/**
* Returns true if the configuration object is valid.
*
@@ -77,6 +89,18 @@ public class SimpleRepositoryConfig implements Validateable
//~--- set methods ----------------------------------------------------------
/**
* Enable or disable the plugin.
*
*
* @param disabled
* @since 1.13
*/
public void setDisabled(boolean disabled)
{
this.disabled = disabled;
}
/**
* Sets the directory for the repositories
*
@@ -90,6 +114,9 @@ public class SimpleRepositoryConfig implements Validateable
//~--- fields ---------------------------------------------------------------
/** Field description */
/** true if the plugin is disabled */
private boolean disabled = false;
/** directory for repositories */
private File repositoryDirectory;
}

View File

@@ -36,9 +36,12 @@ Sonia.git.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
// labels
titleText: 'Git Settings',
repositoryDirectoryText: 'Repository directory',
disabledText: 'Disabled',
// helpTexts
repositoryDirectoryHelpText: 'Location of the Git repositories.',
disabledHelpText: 'Enable or disable the Git plugin.\n\
Note you have to reload the page, after changing this value.',
initComponent: function(){
@@ -51,6 +54,12 @@ Sonia.git.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
fieldLabel: this.repositoryDirectoryText,
helpText: this.repositoryDirectoryHelpText,
allowBlank : false
},{
xtype: 'checkbox',
name: 'disabled',
fieldLabel: this.disabledText,
inputValue: 'true',
helpText: this.disabledHelpText
}]
}
@@ -71,9 +80,12 @@ if ( i18n != null && i18n.country == 'de' ){
// labels
titleText: 'Git Einstellungen',
repositoryDirectoryText: 'Repository-Verzeichnis',
disabledText: 'Deaktivieren',
// helpTexts
repositoryDirectoryHelpText: 'Verzeichnis der Git-Repositories.'
repositoryDirectoryHelpText: 'Verzeichnis der Git-Repositories.',
disabledHelpText: 'Aktivieren oder deaktivieren des Git Plugins.\n\
Die Seite muss neu geladen werden wenn dieser Wert geändert wird.'
});

View File

@@ -43,6 +43,7 @@ Sonia.hg.ConfigPanel = Ext.extend(Sonia.config.ConfigForm, {
useOptimizedBytecodeText: 'Optimized Bytecode (.pyo)',
configWizardText: 'Start Configuration Wizard',
configWizardLabelText: 'Start Configuration Wizard',
disabledText: 'Disabled',
// helpText
hgBinaryHelpText: 'Location of Mercurial binary.',
@@ -50,6 +51,8 @@ Sonia.hg.ConfigPanel = Ext.extend(Sonia.config.ConfigForm, {
pythonPathHelpText: 'Python Module Search Path (PYTHONPATH).',
repositoryDirectoryHelpText: 'Location of the Mercurial repositories.',
useOptimizedBytecodeHelpText: 'Use the Python "-O" switch.',
disabledHelpText: 'Enable or disable the Mercurial plugin. \n\
Note you have to reload the page, after changing this value.',
initComponent: function(){
@@ -84,6 +87,12 @@ Sonia.hg.ConfigPanel = Ext.extend(Sonia.config.ConfigForm, {
fieldLabel: this.useOptimizedBytecodeText,
inputValue: 'true',
helpText: this.useOptimizedBytecodeHelpText
},{
xtype: 'checkbox',
name: 'disabled',
fieldLabel: this.disabledText,
inputValue: 'true',
helpText: this.disabledHelpText
},{
xtype: 'button',
text: this.configWizardText,
@@ -182,14 +191,16 @@ if ( i18n != null && i18n.country == 'de' ){
autoConfigLabelText: 'Automatische Einstellung',
configWizardText: 'Konfigurations-Assistenten starten',
configWizardLabelText: 'Konfigurations-Assistent',
disabledText: 'Deaktivieren',
// helpText
hgBinaryHelpText: 'Pfad zum "hg" Befehl.',
pythonBinaryHelpText: 'Pfad zum "python" Befehl.',
pythonPathHelpText: 'Python Modul Suchpfad (PYTHONPATH).',
repositoryDirectoryHelpText: 'Verzeichnis der Mercurial-Repositories.',
useOptimizedBytecodeHelpText: 'Optimierten Bytecode verwenden (python -O).'
useOptimizedBytecodeHelpText: 'Optimierten Bytecode verwenden (python -O).',
disabledHelpText: 'Aktivieren oder deaktivieren des Mercurial Plugins.\n\
Die Seite muss neu geladen werden wenn dieser Wert geändert wird.'
});
}

View File

@@ -40,9 +40,12 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
pre14CompatibleText: 'Pre 1.4 Compatible',
pre15CompatibleText: 'Pre 1.5 Compatible',
pre16CompatibleText: 'Pre 1.6 Compatible',
disabledText: 'Disabled',
// helpTexts
repositoryDirectoryHelpText: 'Location of the Suberversion repositories.',
disabledHelpText: 'Enable or disable the Subversion plugin.\n\
Note you have to reload the page, after changing this value.',
initComponent: function(){
@@ -76,6 +79,12 @@ Sonia.svn.ConfigPanel = Ext.extend(Sonia.config.SimpleConfigForm, {
inputValue: 'PRE16',
name: 'compatibility'
}]
},{
xtype: 'checkbox',
name: 'disabled',
fieldLabel: this.disabledText,
inputValue: 'true',
helpText: this.disabledHelpText
}]
}
@@ -100,10 +109,12 @@ if ( i18n != null && i18n.country == 'de' ){
pre14CompatibleText: 'Mit Versionen vor 1.4 kompatibel',
pre15CompatibleText: 'Mit Versionen vor 1.5 kompatibel',
pre16CompatibleText: 'Mit Versionen vor 1.6 kompatibel',
disabledText: 'Deaktivieren',
// helpTexts
repositoryDirectoryHelpText: 'Verzeichnis der Subversion-Repositories.'
repositoryDirectoryHelpText: 'Verzeichnis der Subversion-Repositories.',
disabledHelpText: 'Aktivieren oder deaktivieren des Subversion Plugins.\n\
Die Seite muss neu geladen werden wenn dieser Wert geändert wird.'
});
}

View File

@@ -151,7 +151,8 @@ if ( Sonia.repository.Grid ){
colCreationDateText: 'Erstellungsdatum',
colUrlText: 'Url',
emptyText: 'Es wurde kein Repository konfiguriert',
formTitleText: 'Repository'
formTitleText: 'Repository',
unknownType: 'Unbekannt'
});
}

View File

@@ -38,6 +38,7 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
colUrlText: 'Url',
emptyText: 'No repository is configured',
formTitleText: 'Repository Form',
unknownType: 'Unknown',
searchValue: null,
typeFilter: null,
@@ -324,9 +325,14 @@ Sonia.repository.Grid = Ext.extend(Sonia.rest.Grid, {
},
renderRepositoryType: function(repositoryType){
return repositoryTypeStore.queryBy(function(rec){
var displayName = this.unknownType;
var rec = repositoryTypeStore.queryBy(function(rec){
return rec.data.name == repositoryType;
}).itemAt(0).data.displayName;
}).itemAt(0);
if ( rec ){
displayName = rec.get('displayName');
}
return displayName;
}
});