Index: programs/mythfrontend/util_menu.xml
===================================================================
--- programs/mythfrontend/util_menu.xml	(revision 19901)
+++ programs/mythfrontend/util_menu.xml	(working copy)
@@ -101,5 +101,11 @@
       <text lang="HE">הגדרה</text>
       <action>MENU main_settings.xml</action>
    </button>
+   <button>
+       <type>MENU_UTILITIES_SETUP</type>
+       <text>Save or Restore settings</text>
+       <description>Save or restore settings settings for MythTV</description>
+       <action>settings_profile</action>
+   </button>
 
 </mythmenu>
Index: programs/mythfrontend/main.cpp
===================================================================
--- programs/mythfrontend/main.cpp	(revision 19901)
+++ programs/mythfrontend/main.cpp	(working copy)
@@ -61,6 +61,7 @@
 #include "mythcontrols.h"
 #include "mythuihelper.h"
 #include "mythdirs.h"
+#include "settings_template.h"
 
 static ExitPrompter   *exitPopup = NULL;
 static MythThemedMenu *menu;
@@ -524,6 +525,25 @@
         showStatus();
     else if (sel == "exiting_app")
         handleExit();
+    else if (sel == "settings_profile")
+    {
+        gContext->ActivateSettingsCache(false);
+        MythCtemplate *setting =  new MythCtemplate();
+        DialogCode res = setting->exec();
+        delete setting;
+
+        if (kDialogCodeRejected != res)
+        {
+            if ( gContext->GetSetting("HOSTrestartfe") == "1" )
+            {
+                qApp->processEvents();
+                GetMythMainWindow()->JumpTo("Reload Theme");
+                RemoteSendMessage("CLEAR_SETTINGS_CACHE");
+                gContext->SaveSetting("HOSTrestartfe","0" );
+            }
+        }
+        gContext->ActivateSettingsCache(true);
+    }
 
     if (sel.left(9) == "settings ")
     {
Index: programs/mythfrontend/mythfrontend.pro
===================================================================
--- programs/mythfrontend/mythfrontend.pro	(revision 19901)
+++ programs/mythfrontend/mythfrontend.pro	(working copy)
@@ -11,6 +11,7 @@
 target.path = $${PREFIX}/bin
 INSTALLS = target
 
+
 setting.path = $${PREFIX}/share/mythtv/
 setting.files += theme.txt mysql.txt
 setting.files += info_menu.xml mainmenu.xml media_settings.xml tv_schedule.xml
@@ -31,6 +32,7 @@
 HEADERS += mediarenderer.h mythfexml.h playbackboxlistitem.h
 HEADERS += mythappearance.h exitprompt.h proglist.h
 HEADERS += action.h mythcontrols.h keybindings.h keygrabber.h
+HEADERS += settings_template.h
 
 SOURCES += main.cpp playbackbox.cpp viewscheduled.cpp
 SOURCES += globalsettings.cpp manualschedule.cpp programrecpriority.cpp
@@ -39,6 +41,8 @@
 SOURCES += custompriority.cpp mythappearance.cpp exitprompt.cpp proglist.cpp
 SOURCES += action.cpp actionset.cpp  mythcontrols.cpp keybindings.cpp
 SOURCES += keygrabber.cpp
+SOURCES += settings_template.cpp
+
 
 macx {
     mac_bundle {
Index: programs/mythfrontend/settings_template.h
===================================================================
--- programs/mythfrontend/settings_template.h	(revision 0)
+++ programs/mythfrontend/settings_template.h	(revision 0)
@@ -0,0 +1,39 @@
+#include <settings.h>
+#include "mythdialogs.h"
+
+class TemplateSettings: public TriggeredConfigurationGroup {
+Q_OBJECT
+public:
+    TemplateSettings();
+    HostComboBox *HOSTtemplatetype;
+    HostComboBox *HostTemplateSave;
+    HostComboBox *HostTemplateRestore;
+    HostComboBox *HostSelectcopy_from;
+    HostComboBox *HostTemplateCopy_restore;
+    HostComboBox *HostTemplateDelete;
+    void fillHOSTtemplatetype();
+    void fillHostTemplateSave();
+    void fillHostTemplateRestore();
+    void fillHostSelectcopy_from();
+    void fillHostTemplateCopy_restore();
+    void fillHostTemplateDelete();
+    void remove_deleted_item(QString);
+
+public slots:
+    void choosetemplate();
+    QString gather_setting(QString);
+};
+
+class ProfileSettings_MainFrame: public VerticalConfigurationGroup {
+Q_OBJECT
+public:
+         ProfileSettings_MainFrame();
+         TransButtonSetting *userapplyButton;
+};
+
+class MythCtemplate: public ConfigurationWizard {
+public:
+    MythCtemplate();
+};
+
+

Property changes on: programs/mythfrontend/settings_template.h
___________________________________________________________________
Added: svn:executable
   + *

Index: programs/mythfrontend/settings_template.cpp
===================================================================
--- programs/mythfrontend/settings_template.cpp	(revision 0)
+++ programs/mythfrontend/settings_template.cpp	(revision 0)
@@ -0,0 +1,355 @@
+#include <mythcontext.h>
+#include <unistd.h>
+#include <iostream>
+#include <fstream>
+#include <stdio.h>
+#include "settings.h"
+#include <qsqldatabase.h>
+#include <qsqlquery.h>
+#include <stdlib.h>
+#include <cstdlib>
+#include <mythtv/mythdbcon.h>
+#include <mythtv/mythdb.h>
+
+#include "settings_template.h"
+
+QString TemplateSettings::gather_setting(QString QUERY)
+{
+    QString returnvalue = "" ;
+    if ( QUERY == "HOSTtemplatetype" )
+        returnvalue=HOSTtemplatetype->getValue();
+    else if ( QUERY == "HostTemplateSave")
+        returnvalue=HostTemplateSave->getValue();
+    else if ( QUERY == "HostTemplateRestore")
+        returnvalue=HostTemplateRestore->getValue();
+    else if ( QUERY == "HostSelectcopy_from")
+        returnvalue=HostSelectcopy_from->getValue();
+    else if ( QUERY == "HostTemplateCopy_restore")
+        returnvalue=HostTemplateCopy_restore->getValue();
+    else if ( QUERY == "HostTemplateDelete")
+        returnvalue=HostTemplateDelete->getValue();
+    return returnvalue;
+}
+
+void TemplateSettings::fillHOSTtemplatetype()
+{
+    HOSTtemplatetype->setLabel(QObject::tr("Settings options"));
+    HOSTtemplatetype->addSelection("Restore");
+    HOSTtemplatetype->addSelection("Save") ;
+    HOSTtemplatetype->addSelection("Copy From");
+    HOSTtemplatetype->addSelection("Delete");
+    HOSTtemplatetype->setHelpText(QObject::tr("Select the command to run."));
+}
+
+void TemplateSettings::fillHostTemplateSave()
+{
+    HostTemplateSave->setLabel(QObject::tr("Save Template"));
+    HostTemplateSave->addSelection("user1") ;
+    HostTemplateSave->addSelection("user2") ;
+    HostTemplateSave->setHelpText(QObject::tr("Save settings under this name"));
+    MSqlQuery query(MSqlQuery::InitCon());
+    QString tempItem;
+    query.prepare( "show tables like \"settings_%\" " );
+    if (query.exec() && query.isActive() && query.size() > 0)
+    {
+        while (query.next())
+        {
+            tempItem = query.value(0).toString();
+            tempItem=tempItem.remove(QRegExp("settings_"));
+            HostTemplateSave->addSelection(tempItem);
+            VERBOSE(VB_IMPORTANT, "Adding " + tempItem + "to save list");
+        }
+    }
+}
+
+void TemplateSettings::fillHostTemplateRestore()
+{
+    HostTemplateRestore->setLabel(QObject::tr("Restore"));
+    QString tempItem;
+    QString current_hostname =  gContext->GetHostName();
+    QString sub_sql;
+    QString returnvalue;
+    MSqlQuery query(MSqlQuery::InitCon());
+    MSqlQuery sub_query(MSqlQuery::InitCon());
+    query.prepare( "show tables like \"settings_%\" " );
+    if (query.exec() && query.isActive() && query.size() > 0)
+    {
+        while (query.next())
+        {
+            tempItem = query.value(0).toString();
+            //if found tables has settings for this hostname add the table
+            sub_sql="SELECT value from ";
+            sub_sql+=tempItem;
+            sub_sql+=" where hostname=:HOSTNAME ;";
+            sub_query.prepare(sub_sql);
+            sub_query.bindValue( ":HOSTNAME" , current_hostname );
+            if (sub_query.exec() && sub_query.isActive() && sub_query.size() > 0)
+            {
+                tempItem=tempItem.remove(QRegExp("settings_"));
+                HostTemplateRestore->addSelection(tempItem);
+                VERBOSE(VB_IMPORTANT, "Adding " + tempItem + "to restore list");
+            }
+            else
+                VERBOSE(VB_IMPORTANT, "Couldn't find settings for " +
+                        current_hostname + " in " + tempItem);
+        }
+    }
+    // check to see if default is present before adding them
+    query.prepare ("SELECT count(data) FROM settings_Default WHERE value = 'Theme' AND hostname = 'Default'");
+    if (query.exec() && query.isActive() && query.size() > 0)
+    {
+    query.next();
+    tempItem = query.value(0).toString();
+    if ( tempItem == "1" )
+        HostTemplateRestore->addSelection("Default");
+    }
+
+    query.prepare ("SELECT count(data) FROM settings_Default WHERE value = 'Theme' AND hostname = 'Default_1'");
+    if (query.exec() && query.isActive() && query.size() > 0)
+    {
+        query.next();
+        tempItem = query.value(0).toString();
+        if ( tempItem == "1" )
+            HostTemplateRestore->addSelection("Default_1");
+    }
+    HostTemplateRestore->setHelpText(QObject::tr("Saved settings to be restored."));
+}
+
+void TemplateSettings:: fillHostSelectcopy_from()
+{
+
+    HostSelectcopy_from->setLabel(QObject::tr("Host"));
+    QString tempItem;
+    MSqlQuery query(MSqlQuery::InitCon());
+    query.prepare( "SELECT DISTINCT hostname from settings where hostname is not null;");
+    if (query.exec() && query.isActive() && query.size() > 0)
+    {
+        while (query.next())
+        {
+            tempItem = query.value(0).toString();
+            tempItem=tempItem.remove(QRegExp("settings_"));
+            HostSelectcopy_from->addSelection(tempItem);
+        }
+    }
+    HostSelectcopy_from->setHelpText(QObject::tr("Select the host to copy settings from."));
+}
+
+
+void TemplateSettings::fillHostTemplateCopy_restore()
+{
+    QString tempItem;
+    HostTemplateCopy_restore->addSelection("Current");
+    HostTemplateCopy_restore->setLabel(QObject::tr("Restore"));
+    QString current_hostname = gContext->GetHostName();
+    MSqlQuery query(MSqlQuery::InitCon());
+    query.prepare( "show tables like \"settings_%\" " );
+    if (query.exec() && query.isActive() && query.size() > 0)
+    {
+        while (query.next())
+        {
+            tempItem = query.value(0).toString();
+            tempItem=tempItem.remove(QRegExp("settings_"));
+            if ( tempItem != "Default" )
+            {
+                HostTemplateCopy_restore->addSelection(tempItem);
+                VERBOSE(VB_IMPORTANT, "Adding " + tempItem + " to copy from  list");
+            }
+        }
+    }
+    else
+        VERBOSE(VB_IMPORTANT, "Didn't find any profiles for copy from  list");
+    HostTemplateCopy_restore->setHelpText(QObject::tr("Select the settings group to restore."));
+
+};
+
+void TemplateSettings::fillHostTemplateDelete()
+{
+    HostTemplateDelete->setLabel(QObject::tr("Delete Template"));
+    HostTemplateDelete->setHelpText(QObject::tr("Delete settings under this name"));
+    MSqlQuery query(MSqlQuery::InitCon());
+    QString tempItem;
+    query.prepare( "show tables like \"settings_%\" " );
+    if (query.exec() && query.isActive() && query.size() > 0)
+    {
+        while (query.next())
+        {
+            tempItem = query.value(0).toString();
+            tempItem=tempItem.remove(QRegExp("settings_"));
+            if ( tempItem != "Default" )
+            {
+                HostTemplateDelete->addSelection(tempItem);
+                VERBOSE(VB_IMPORTANT, "Adding " + tempItem + "to Delete list");
+            }
+        }
+    }
+}
+
+void TemplateSettings::remove_deleted_item(QString ditem)
+{
+
+        HostTemplateDelete->setValue(0);
+        HostTemplateDelete->removeSelection(ditem);
+        HostTemplateRestore->removeSelection(ditem);
+}
+
+
+TemplateSettings::TemplateSettings(): TriggeredConfigurationGroup(true)
+{
+    setLabel(QObject::tr("Manage Settings"));
+    HOSTtemplatetype= new HostComboBox("HOSTtemplatetype");
+    HostTemplateSave= new HostComboBox("HostTemplateSave",true);
+    HostTemplateRestore = new HostComboBox("HostTemplateRestore");
+    HostSelectcopy_from = new HostComboBox("HostSelectcopy_from");
+    HostTemplateCopy_restore = new HostComboBox("HostTemplateCopy_restore");
+    HostTemplateDelete = new HostComboBox("HostTemplateDelete");
+
+    fillHOSTtemplatetype();
+    fillHostTemplateSave();
+    fillHostTemplateRestore();
+    fillHostSelectcopy_from();
+    fillHostTemplateCopy_restore();
+    fillHostTemplateDelete();
+
+    Setting* Mtemplate = HOSTtemplatetype;
+    addChild(Mtemplate);
+    setTrigger(Mtemplate);
+
+    ConfigurationGroup* trestore = new VerticalConfigurationGroup(false);
+        trestore->addChild(HostTemplateRestore);
+
+    ConfigurationGroup* tsave = new VerticalConfigurationGroup(false);
+        tsave->addChild(HostTemplateSave);
+
+    ConfigurationGroup* tcopy = new VerticalConfigurationGroup(false);
+        tcopy->addChild(HostSelectcopy_from);
+        tcopy->addChild(HostTemplateCopy_restore);
+
+    ConfigurationGroup* tdelete = new VerticalConfigurationGroup(false);
+        tdelete->addChild(HostTemplateDelete);
+
+    addTarget("Restore", trestore);
+    addTarget("Save", tsave);
+    addTarget("Copy From", tcopy);
+    addTarget("Delete", tdelete);
+
+};
+
+void popup_error(){
+    QString errorText="Could not find any settings to restore.";
+    MythPopupBox::showOkPopup(gContext->GetMainWindow(),
+                "Open Failed",
+                    errorText);
+}
+
+void TemplateSettings::choosetemplate ()
+{
+    QString templateop;
+    QString templatename;
+    QString templatehostname="";
+    templateop=gather_setting("HOSTtemplatetype");
+    VERBOSE(VB_IMPORTANT, "Button was pressed... " + templateop);
+    VERBOSE(VB_IMPORTANT, "####################################");
+    templatename = "none";
+    if ( templateop == "Save" )
+    {
+        templatename=gather_setting("HostTemplateSave");
+        templatehostname=gContext->GetHostName();
+        VERBOSE(VB_IMPORTANT, "FE----RUNNING... ...." + templateop + "  " + templatename );
+        savesettings(templatehostname,templatename);
+    }
+    else if ( templateop == "Restore" )
+    {
+        //Run Check to see if settings are present
+        templatename=gather_setting("HostTemplateRestore");
+        templatehostname=gContext->GetHostName();
+        VERBOSE(VB_IMPORTANT, "FE----RUNNING... " + templateop + "  " + templatename );
+        if ( templatename == "Default")
+        {
+            if ( settings_check(templatename,"Default") )
+            {
+                VERBOSE(VB_IMPORTANT, "FE----RUNNING... c_from  " + templateop + "  " + templatename );
+                c_from("Default" , "Default",gContext->GetHostName());
+                gContext->SaveSetting("HOSTrestartfe","1" );
+            }
+            else
+            {
+                popup_error();
+            }
+        }
+        else if ( templatename == "Default_1")
+        {
+            if ( settings_check("Default" ,"Default_1") )
+            {
+                VERBOSE(VB_IMPORTANT, "FE----RUNNING... c_from  " + templateop + "  " + templatename );
+                c_from("Default_1" , "Default",gContext->GetHostName() );
+                gContext->SaveSetting("HOSTrestartfe","1" );
+            }
+            else
+            {
+                popup_error();
+            }
+        }
+        else
+        {
+            if ( settings_check(templatename,templatehostname) )
+            {
+                restoresettings(templatehostname,templatename);
+                gContext->SaveSetting("HOSTrestartfe","1" );
+            }
+            else
+            {
+                popup_error();
+            }
+        }
+    }
+    else if ( templateop == "Copy From" )
+    {
+        templatehostname=gather_setting("HostSelectcopy_from");
+        templatename=gather_setting("HostTemplateCopy_restore");
+
+        if ( settings_check(templatename,templatehostname) )
+        {
+            gContext->SaveSetting("HOSTrestartfe","1" );
+            VERBOSE(VB_IMPORTANT, "FE----RUNNING... ...." + templateop + "  " + templatename + " " + templatehostname );
+            c_from(templatehostname,templatename,gContext->GetHostName());
+        }
+        else
+        {
+            popup_error();
+        }
+    }
+    else if ( templateop == "Delete" )
+    {
+        templatehostname=gContext->GetHostName();
+        templatename=gather_setting("HostTemplateDelete");
+        deletesettings(templatehostname,templatename);
+        remove_deleted_item(templatename);
+    }
+    VERBOSE(VB_IMPORTANT, "####################################");
+
+};
+
+ProfileSettings_MainFrame::ProfileSettings_MainFrame():
+VerticalConfigurationGroup(false,false,false,false)
+{
+    setLabel(QObject::tr("Save/Backup settings"));
+    TemplateSettings *templatesettings = new TemplateSettings();
+
+    userapplyButton = new TransButtonSetting;
+    userapplyButton->setLabel("Run");
+
+    VerticalConfigurationGroup* frame_profile =
+            new VerticalConfigurationGroup(false, true,false,false);
+    frame_profile->addChild(templatesettings);
+    frame_profile->addChild(userapplyButton);
+
+    addChild(frame_profile);
+    connect(userapplyButton, SIGNAL(pressed()),
+            templatesettings,SLOT(choosetemplate()));
+};
+
+MythCtemplate::MythCtemplate()
+{
+    ProfileSettings_MainFrame *profilesettings_mainframe = new ProfileSettings_MainFrame();
+    addChild(profilesettings_mainframe);
+};

Property changes on: programs/mythfrontend/settings_template.cpp
___________________________________________________________________
Added: svn:executable
   + *

Index: programs/programs.pro
===================================================================
--- programs/programs.pro	(revision 19900)
+++ programs/programs.pro	(working copy)
@@ -8,6 +8,7 @@
     SUBDIRS += mythtv mythfrontend mythcommflag
     SUBDIRS += mythtvosd mythjobqueue mythlcdserver
     SUBDIRS += mythwelcome mythshutdown mythtranscode/replex
+    SUBDIRS += mythsettings
 }
 
 using_backend {
Index: programs/mythsettings/mythsettings.pro
===================================================================
--- programs/mythsettings/mythsettings.pro	(revision 0)
+++ programs/mythsettings/mythsettings.pro	(revision 0)
@@ -0,0 +1,18 @@
+include ( ../../config.mak )
+include ( ../../settings.pro )
+include ( ../programs-libs.pro )
+
+QT += network xml sql qt3support
+
+TEMPLATE = app
+CONFIG += thread
+CONFIG -= moc
+TARGET = mythsettings
+target.path = $${PREFIX}/bin
+INSTALLS = target
+
+QMAKE_CLEAN += $(TARGET)
+
+# Input
+
+SOURCES += main.cpp
Index: programs/mythsettings/main.cpp
===================================================================
--- programs/mythsettings/main.cpp	(revision 0)
+++ programs/mythsettings/main.cpp	(revision 0)
@@ -0,0 +1,183 @@
+// C headers
+#include <unistd.h>
+
+// C++ headers
+#include <iostream>
+using namespace std;
+
+// Qt headers
+#include <QApplication>
+
+// libmyth headers
+#include "exitcodes.h"
+#include "mythcontext.h"
+#include "mythdb.h"
+#include "mythverbose.h"
+#include "mythversion.h"
+//#include "settemplate.h"
+
+
+
+int main(int argc, char *argv[])
+{
+    QApplication a(argc, argv, false);
+    QString templateop="";
+    QString templatename="";
+    QString templatehostname="";
+    QStringList template_c_line;
+    int argpos = 1;
+    cout << a.argc() << endl;
+    if ( a.argc() <=1 )
+    {
+    cerr << "Missing argument, run -h to see the help \n";
+    return 3;
+    };
+
+    while (argpos < a.argc())
+    {
+    if (!strcmp(a.argv()[argpos],"-t"))
+        {
+            if (a.argc()-1 > argpos)
+            {
+                QString tmpArg = a.argv()[argpos+1];
+                if (tmpArg.startsWith("-"))
+                {
+                    cerr << "Invalid or missing argument to -t \n";
+                    return 3;
+                }
+                else
+                {
+                    templatename=tmpArg;
+                }
+                ++argpos;
+            }
+        }
+        else if (!strcmp(a.argv()[argpos], "-o"))
+        {
+            if (a.argc()-1 > argpos)
+            {
+                QString tmpArg = a.argv()[argpos+1];
+                if (tmpArg.startsWith("-") || tmpArg == "" )
+                {
+                    cerr << "Missing argument to -o \n";
+                    return 3;
+                }
+                else if ( tmpArg != "save" &&
+                          tmpArg != "restore" &&
+                          tmpArg != "copy_from" &&
+                          tmpArg != "delete" )
+                {
+                    cerr << "Invalid argument to -o \n";
+                    return 3;
+                }
+                else
+                {
+                    templateop=tmpArg;
+                }
+                ++argpos;
+            }
+
+        }
+        else if (!strcmp(a.argv()[argpos], "-n"))
+        {
+            if (a.argc()-1 > argpos)
+            {
+                QString tmpArg = a.argv()[argpos+1];
+                if (tmpArg.startsWith("-"))
+                {
+                    cerr << "Invalid or missing argument to -n \n";
+                    return 3;
+                }
+                else
+                {
+                    templatehostname=tmpArg;
+                }
+                ++argpos;
+            }
+        }
+        else if (!strcmp(a.argv()[argpos], "-h") ||
+                !strcmp(a.argv()[argpos], "--help"))
+        {
+            VERBOSE(VB_IMPORTANT, "-o [save|restore|copy_from|delete]");
+            VERBOSE(VB_IMPORTANT, "-t template_name ");
+            VERBOSE(VB_IMPORTANT, "-n  hostname");
+            return 3;
+        }
+        else
+        {
+            fprintf(stderr, "illegal option: '%s' (use --help)\n",
+                    a.argv()[argpos]);
+            return 3;
+        }
+        ++argpos;
+    }
+    if ( templatename == "" )
+    {
+        VERBOSE(VB_IMPORTANT, "Missing template name");
+        return 2;
+    }
+    if ( templateop == "" )
+    {
+        VERBOSE(VB_IMPORTANT, "Missing operation");
+        return 2;
+    }
+    if ( templatehostname == "" )
+    {
+        VERBOSE(VB_IMPORTANT, "Missing hostname");
+        return 2;
+    }
+    VERBOSE(VB_IMPORTANT, "Using template:" +  templatename);
+    VERBOSE(VB_IMPORTANT, "Using Operation:" +  templateop);
+    if  ( templateop == "copy_from" )
+        VERBOSE(VB_IMPORTANT, "Copy from host:" +  templatehostname);
+
+    gContext = NULL;
+    gContext = new MythContext(MYTH_BINARY_VERSION);
+    if (!gContext->Init(false))
+    {
+        VERBOSE(VB_IMPORTANT, "Failed to init MythContext, exiting.");
+        delete gContext;
+        return FILLDB_EXIT_NO_MYTHCONTEXT;
+    }
+
+    if (!MSqlQuery::testDBConnection())
+    {
+        VERBOSE(VB_IMPORTANT, "Could not open the database. "
+                        "Exiting.");
+        return -1;
+    }
+
+    if ( templateop == "save" )
+    {
+        savesettings(templatehostname,templatename);
+    }
+
+    if ( templateop == "restore" )
+    {
+        if ( templatename == "Default" )
+            c_from("Default" , templatename);
+        else if ( templatename == "Default_1")
+            c_from ("Default_1" , templatename );
+        else if ( settings_check(templatename,templatehostname) )
+        {
+                cout << "--------------------------" << endl;
+                restoresettings(templatehostname,templatename);
+        }
+    }
+
+    if ( templateop == "delete" )
+        deletesettings(templatehostname,templatename);
+
+    if ( templateop == "copy_from" )
+    {
+        if ( templatename=="")
+            templatename="current";
+        c_from(templatehostname,templatename);
+    }
+
+    delete gContext;
+    VERBOSE(VB_IMPORTANT, "settings op " + templateop + " " + templatename + " run complete.");
+    return 0;
+}
+
+/* vim: set expandtab tabstop=4 shiftwidth=4: */

