|
|
|
@ -333,11 +333,11 @@ void KNutClient::initVars (void) {
|
|
|
|
|
|
|
|
|
|
TQString groupName;
|
|
|
|
|
KNutUpsData::upsRecordDef upsData; // structure includes informations about UPS // struktura obsahuje udaje o UPS
|
|
|
|
|
TQFont appFont = kapp->font(); // systemovy font pri startu
|
|
|
|
|
kapp->config()->setGroup ("");
|
|
|
|
|
settingData.areYouSure=kapp->config()->readBoolEntry("AreYouSure",FALSE);
|
|
|
|
|
TQFont appFont = tdeApp->font(); // systemovy font pri startu
|
|
|
|
|
tdeApp->config()->setGroup ("");
|
|
|
|
|
settingData.areYouSure=tdeApp->config()->readBoolEntry("AreYouSure",FALSE);
|
|
|
|
|
|
|
|
|
|
int helpInt=kapp->config()->readNumEntry("UseMainWindow",TRUE);
|
|
|
|
|
int helpInt=tdeApp->config()->readNumEntry("UseMainWindow",TRUE);
|
|
|
|
|
|
|
|
|
|
//std::cout << "readNumEntry " << helpInt << "--" << std::endl;
|
|
|
|
|
switch (helpInt) {
|
|
|
|
@ -347,55 +347,55 @@ void KNutClient::initVars (void) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
settingData.useMessageWindow=kapp->config()->readBoolEntry("UseMessageWindow",FALSE);
|
|
|
|
|
settingData.activatedMainWindow=kapp->config()->readBoolEntry("PreviousMainWindow",FALSE);
|
|
|
|
|
settingData.x=kapp->config()->readNumEntry("PosX",0);
|
|
|
|
|
settingData.y=kapp->config()->readNumEntry("PosY",0);
|
|
|
|
|
settingData.width=kapp->config()->readNumEntry("Width",300);
|
|
|
|
|
settingData.height=kapp->config()->readNumEntry("Height",200);
|
|
|
|
|
settingData.useDescription=kapp->config()->readBoolEntry("UseDescription",FALSE);
|
|
|
|
|
settingData.countCols=kapp->config()->readNumEntry("NumberOfCols",knc::DefaultCountCols);
|
|
|
|
|
settingData.panelFlags=kapp->config()->readUnsignedNumEntry("PanelFlags",KNutFrontPanel::DefaultPanelFlags);
|
|
|
|
|
settingData.inputFrequency=kapp->config()->readNumEntry("InputFrequency",knc::DefaultInputFrequency);
|
|
|
|
|
settingData.inputVoltage=kapp->config()->readNumEntry("InputVoltage",knc::DefaultInputVoltage);
|
|
|
|
|
settingData.lowHighXfer=kapp->config()->readBoolEntry("LowHighXfer",FALSE);
|
|
|
|
|
settingData.customFont=kapp->config()->readBoolEntry("CustomFont",FALSE);
|
|
|
|
|
settingData.aPanelFont=kapp->config()->readFontEntry("AnalogPanelFont",&appFont);
|
|
|
|
|
settingData.mPanelFont=kapp->config()->readFontEntry("MainPanelFont",&appFont);
|
|
|
|
|
int upsCount=kapp->config()->readNumEntry("NumberOfUpsRecords",0);
|
|
|
|
|
settingData.customBColor=kapp->config()->readBoolEntry("CustomBColor",FALSE);
|
|
|
|
|
settingData.mainBackgroundColor=kapp->config()->readColorEntry ("MainBackGroundColor",& DEFAULT_BG_COLOR);
|
|
|
|
|
settingData.customBPanelColor=kapp->config()->readBoolEntry("CustomBPanelColor",FALSE);
|
|
|
|
|
settingData.customBAnalogColor=kapp->config()->readBoolEntry("CustomBAnalogColor",FALSE);
|
|
|
|
|
settingData.customOAnalogColor=kapp->config()->readBoolEntry("CustomOAnalogColor",FALSE);
|
|
|
|
|
settingData.mPanelBackgroundColor=kapp->config()->readColorEntry ("MPanelBackGroundColor",& DEFAULT_BG_COLOR);
|
|
|
|
|
settingData.aPanelBackgroundColor=kapp->config()->readColorEntry ("APanelBackGroundColor",& DEFAULT_BG_COLOR);
|
|
|
|
|
settingData.analogFingerColor=kapp->config()->readColorEntry ("AnalogFingerColor",& DEFAULT_FINGER_COLOR);
|
|
|
|
|
settingData.analogOKColor=kapp->config()->readColorEntry ("AnalogOKColor",& DEFAULT_OK_COLOR);
|
|
|
|
|
settingData.analogWarnningColor=kapp->config()->readColorEntry ("AnalogWarnningColor",& DEFAULT_WARNNING_COLOR);
|
|
|
|
|
settingData.analogErrorColor=kapp->config()->readColorEntry ("AnalogErrorColor",& DEFAULT_ERROR_COLOR);
|
|
|
|
|
settingData.analogScaleColor=kapp->config()->readColorEntry ("AnalogScaleColor",& DEFAULT_SCALE_COLOR);
|
|
|
|
|
settingData.analogFontColor=kapp->config()->readColorEntry ("AnalogFontColor",& DEFAULT_FONT_COLOR);
|
|
|
|
|
settingData.toolTipFlags=kapp->config()->readUnsignedNumEntry("ToolTipFlags",KNutDock::DefaultToolTipFlags);
|
|
|
|
|
settingData.customTDEIconColor=kapp->config()->readBoolEntry("CustomTDEIconColor",FALSE);
|
|
|
|
|
settingData.kIconBackgroundColor=kapp->config()->readColorEntry ("TDEIconBackGroundColor",& DEFAULT_KICON_COLOR);
|
|
|
|
|
settingData.typeOfTDEIcon=kapp->config()->readBoolEntry("TypeOfTDEIcon", KNutDock::pictureKI);
|
|
|
|
|
settingData.typeDigitalProcessing=kapp->config()->readNumEntry("DigitalProcessingOfPointers", 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_mainUpsInfo.record.name=kapp->config()->readEntry("ActiveUps","");
|
|
|
|
|
settingData.useMessageWindow=tdeApp->config()->readBoolEntry("UseMessageWindow",FALSE);
|
|
|
|
|
settingData.activatedMainWindow=tdeApp->config()->readBoolEntry("PreviousMainWindow",FALSE);
|
|
|
|
|
settingData.x=tdeApp->config()->readNumEntry("PosX",0);
|
|
|
|
|
settingData.y=tdeApp->config()->readNumEntry("PosY",0);
|
|
|
|
|
settingData.width=tdeApp->config()->readNumEntry("Width",300);
|
|
|
|
|
settingData.height=tdeApp->config()->readNumEntry("Height",200);
|
|
|
|
|
settingData.useDescription=tdeApp->config()->readBoolEntry("UseDescription",FALSE);
|
|
|
|
|
settingData.countCols=tdeApp->config()->readNumEntry("NumberOfCols",knc::DefaultCountCols);
|
|
|
|
|
settingData.panelFlags=tdeApp->config()->readUnsignedNumEntry("PanelFlags",KNutFrontPanel::DefaultPanelFlags);
|
|
|
|
|
settingData.inputFrequency=tdeApp->config()->readNumEntry("InputFrequency",knc::DefaultInputFrequency);
|
|
|
|
|
settingData.inputVoltage=tdeApp->config()->readNumEntry("InputVoltage",knc::DefaultInputVoltage);
|
|
|
|
|
settingData.lowHighXfer=tdeApp->config()->readBoolEntry("LowHighXfer",FALSE);
|
|
|
|
|
settingData.customFont=tdeApp->config()->readBoolEntry("CustomFont",FALSE);
|
|
|
|
|
settingData.aPanelFont=tdeApp->config()->readFontEntry("AnalogPanelFont",&appFont);
|
|
|
|
|
settingData.mPanelFont=tdeApp->config()->readFontEntry("MainPanelFont",&appFont);
|
|
|
|
|
int upsCount=tdeApp->config()->readNumEntry("NumberOfUpsRecords",0);
|
|
|
|
|
settingData.customBColor=tdeApp->config()->readBoolEntry("CustomBColor",FALSE);
|
|
|
|
|
settingData.mainBackgroundColor=tdeApp->config()->readColorEntry ("MainBackGroundColor",& DEFAULT_BG_COLOR);
|
|
|
|
|
settingData.customBPanelColor=tdeApp->config()->readBoolEntry("CustomBPanelColor",FALSE);
|
|
|
|
|
settingData.customBAnalogColor=tdeApp->config()->readBoolEntry("CustomBAnalogColor",FALSE);
|
|
|
|
|
settingData.customOAnalogColor=tdeApp->config()->readBoolEntry("CustomOAnalogColor",FALSE);
|
|
|
|
|
settingData.mPanelBackgroundColor=tdeApp->config()->readColorEntry ("MPanelBackGroundColor",& DEFAULT_BG_COLOR);
|
|
|
|
|
settingData.aPanelBackgroundColor=tdeApp->config()->readColorEntry ("APanelBackGroundColor",& DEFAULT_BG_COLOR);
|
|
|
|
|
settingData.analogFingerColor=tdeApp->config()->readColorEntry ("AnalogFingerColor",& DEFAULT_FINGER_COLOR);
|
|
|
|
|
settingData.analogOKColor=tdeApp->config()->readColorEntry ("AnalogOKColor",& DEFAULT_OK_COLOR);
|
|
|
|
|
settingData.analogWarnningColor=tdeApp->config()->readColorEntry ("AnalogWarnningColor",& DEFAULT_WARNNING_COLOR);
|
|
|
|
|
settingData.analogErrorColor=tdeApp->config()->readColorEntry ("AnalogErrorColor",& DEFAULT_ERROR_COLOR);
|
|
|
|
|
settingData.analogScaleColor=tdeApp->config()->readColorEntry ("AnalogScaleColor",& DEFAULT_SCALE_COLOR);
|
|
|
|
|
settingData.analogFontColor=tdeApp->config()->readColorEntry ("AnalogFontColor",& DEFAULT_FONT_COLOR);
|
|
|
|
|
settingData.toolTipFlags=tdeApp->config()->readUnsignedNumEntry("ToolTipFlags",KNutDock::DefaultToolTipFlags);
|
|
|
|
|
settingData.customTDEIconColor=tdeApp->config()->readBoolEntry("CustomTDEIconColor",FALSE);
|
|
|
|
|
settingData.kIconBackgroundColor=tdeApp->config()->readColorEntry ("TDEIconBackGroundColor",& DEFAULT_KICON_COLOR);
|
|
|
|
|
settingData.typeOfTDEIcon=tdeApp->config()->readBoolEntry("TypeOfTDEIcon", KNutDock::pictureKI);
|
|
|
|
|
settingData.typeDigitalProcessing=tdeApp->config()->readNumEntry("DigitalProcessingOfPointers", 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_mainUpsInfo.record.name=tdeApp->config()->readEntry("ActiveUps","");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < upsCount; i++) {
|
|
|
|
|
groupName.sprintf ("UPS %d",i);
|
|
|
|
|
kapp->config()->setGroup (groupName);
|
|
|
|
|
if ((upsData.name = kapp->config()->readEntry ("Name")) != TQChar::null) {
|
|
|
|
|
tdeApp->config()->setGroup (groupName);
|
|
|
|
|
if ((upsData.name = tdeApp->config()->readEntry ("Name")) != TQChar::null) {
|
|
|
|
|
// record exist, we will go next part
|
|
|
|
|
//if ActiveUps is empty, we use name of first ups from ups list
|
|
|
|
|
if ((m_mainUpsInfo.record.name.isEmpty()) && (!(upsData.name.isEmpty())))
|
|
|
|
|
m_mainUpsInfo.record.name = upsData.name;
|
|
|
|
|
upsData.upsName = kapp->config()->readEntry ("UpsName","");
|
|
|
|
|
if (((upsData.upsAddress = kapp->config()->readEntry ("UpsAddress")) != TQChar::null)
|
|
|
|
|
upsData.upsName = tdeApp->config()->readEntry ("UpsName","");
|
|
|
|
|
if (((upsData.upsAddress = tdeApp->config()->readEntry ("UpsAddress")) != TQChar::null)
|
|
|
|
|
|| (( upsData.upsAddress == TQChar::null) && (upsData.upsName != TQChar::null ))) {
|
|
|
|
|
|
|
|
|
|
// only for backwards compatibility with older release then 0.7
|
|
|
|
@ -412,14 +412,14 @@ void KNutClient::initVars (void) {
|
|
|
|
|
}
|
|
|
|
|
// zaznam existuje pokracujeme dale a nacteme zbytek hodnotet
|
|
|
|
|
// record exists, we go next and will read rest of values
|
|
|
|
|
upsData.delay = kapp->config()->readNumEntry("Delay",knc::DefaultDelay);
|
|
|
|
|
upsData.port = (unsigned short)kapp->config()->readNumEntry("Port",knc::DefaultPort);
|
|
|
|
|
upsData.userName=kapp->config()->readEntry("UserName","");
|
|
|
|
|
upsData.password=kapp->config()->readEntry("Password","");
|
|
|
|
|
upsData.savePassword=kapp->config()->readBoolEntry("SavePassword",false);
|
|
|
|
|
upsData.delay = tdeApp->config()->readNumEntry("Delay",knc::DefaultDelay);
|
|
|
|
|
upsData.port = (unsigned short)tdeApp->config()->readNumEntry("Port",knc::DefaultPort);
|
|
|
|
|
upsData.userName=tdeApp->config()->readEntry("UserName","");
|
|
|
|
|
upsData.password=tdeApp->config()->readEntry("Password","");
|
|
|
|
|
upsData.savePassword=tdeApp->config()->readBoolEntry("SavePassword",false);
|
|
|
|
|
for (int j=0; j < knc::NumberOfVars; j++) {
|
|
|
|
|
groupName.sprintf ("Var %d",j);
|
|
|
|
|
upsData.upsVarCode[j]=kapp->config()->readNumEntry (groupName,0);
|
|
|
|
|
upsData.upsVarCode[j]=tdeApp->config()->readNumEntry (groupName,0);
|
|
|
|
|
if ((upsData.upsVarCode[j] < 0) || (upsData.upsVarCode[j] > knc::NumberOfTypes))
|
|
|
|
|
upsData.upsVarCode[j] = 0;
|
|
|
|
|
}
|
|
|
|
@ -435,81 +435,81 @@ void KNutClient::saveConfiguration ( bool all ) {
|
|
|
|
|
KNutUpsData::upsRecordDef upsData; // struktura obsahuje udaje o UPS // structure includes information about UPS
|
|
|
|
|
int upsCount = upsRecords->getCount();
|
|
|
|
|
|
|
|
|
|
kapp->config()->setGroup ("");
|
|
|
|
|
tdeApp->config()->setGroup ("");
|
|
|
|
|
|
|
|
|
|
if (all) {
|
|
|
|
|
kapp->config()->writeEntry ("DigitalProcessingOfPointers",settingData.typeDigitalProcessing);
|
|
|
|
|
kapp->config()->writeEntry ("TypeOfTDEIcon",settingData.typeOfTDEIcon);
|
|
|
|
|
kapp->config()->writeEntry ("TDEIconBackGroundColor",settingData.kIconBackgroundColor);
|
|
|
|
|
kapp->config()->writeEntry ("CustomTDEIconColor",(settingData.customTDEIconColor));
|
|
|
|
|
kapp->config()->writeEntry ("ToolTipFlags",(settingData.toolTipFlags));
|
|
|
|
|
tdeApp->config()->writeEntry ("DigitalProcessingOfPointers",settingData.typeDigitalProcessing);
|
|
|
|
|
tdeApp->config()->writeEntry ("TypeOfTDEIcon",settingData.typeOfTDEIcon);
|
|
|
|
|
tdeApp->config()->writeEntry ("TDEIconBackGroundColor",settingData.kIconBackgroundColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("CustomTDEIconColor",(settingData.customTDEIconColor));
|
|
|
|
|
tdeApp->config()->writeEntry ("ToolTipFlags",(settingData.toolTipFlags));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//if name of active ups isn't knowly, will use name of the firt ups from ups list
|
|
|
|
|
if ((m_mainUpsInfo.record.name.isEmpty()) && (upsCount > 0)) {
|
|
|
|
|
upsRecords->get(0,upsData);
|
|
|
|
|
kapp->config()->writeEntry ("ActiveUps",upsData.name);
|
|
|
|
|
tdeApp->config()->writeEntry ("ActiveUps",upsData.name);
|
|
|
|
|
}
|
|
|
|
|
else kapp->config()->writeEntry ("ActiveUps",(TQString)m_mainUpsInfo.record.name); //
|
|
|
|
|
else tdeApp->config()->writeEntry ("ActiveUps",(TQString)m_mainUpsInfo.record.name); //
|
|
|
|
|
|
|
|
|
|
if (all) {
|
|
|
|
|
kapp->config()->writeEntry ("AnalogFontColor",settingData.analogFontColor);
|
|
|
|
|
kapp->config()->writeEntry ("AnalogScaleColor",settingData.analogScaleColor);
|
|
|
|
|
kapp->config()->writeEntry ("AnalogErrorColor",settingData.analogErrorColor);
|
|
|
|
|
kapp->config()->writeEntry ("AnalogWarnningColor",settingData.analogWarnningColor);
|
|
|
|
|
kapp->config()->writeEntry ("AnalogOKColor",settingData.analogOKColor);
|
|
|
|
|
kapp->config()->writeEntry ("AnalogFingerColor",settingData.analogFingerColor);
|
|
|
|
|
kapp->config()->writeEntry ("APanelBackGroundColor",settingData.aPanelBackgroundColor);
|
|
|
|
|
kapp->config()->writeEntry ("MPanelBackGroundColor",settingData.mPanelBackgroundColor);
|
|
|
|
|
kapp->config()->writeEntry ("MainBackGroundColor",settingData.mainBackgroundColor);
|
|
|
|
|
kapp->config()->writeEntry ("NumberOfUpsRecords",upsCount);
|
|
|
|
|
kapp->config()->writeEntry ("CustomFont",settingData.customFont);
|
|
|
|
|
kapp->config()->writeEntry ("AnalogPanelFont",settingData.aPanelFont);
|
|
|
|
|
kapp->config()->writeEntry ("MainPanelFont",settingData.mPanelFont);
|
|
|
|
|
kapp->config()->writeEntry ("CustomBColor",(settingData.customBColor));
|
|
|
|
|
kapp->config()->writeEntry ("CustomBPanelColor",(settingData.customBPanelColor));
|
|
|
|
|
kapp->config()->writeEntry ("CustomBAnalogColor",(settingData.customBAnalogColor));
|
|
|
|
|
kapp->config()->writeEntry ("CustomOAnalogColor",(settingData.customOAnalogColor));
|
|
|
|
|
kapp->config()->writeEntry ("LowHighXfer",(settingData.lowHighXfer));
|
|
|
|
|
kapp->config()->writeEntry ("InputVoltage",(settingData.inputVoltage));
|
|
|
|
|
kapp->config()->writeEntry ("InputFrequency",(settingData.inputFrequency));
|
|
|
|
|
kapp->config()->writeEntry ("PanelFlags",(settingData.panelFlags | 3));
|
|
|
|
|
kapp->config()->writeEntry ("NumberOfCols",settingData.countCols);
|
|
|
|
|
kapp->config()->writeEntry ("UseDescription",settingData.useDescription);
|
|
|
|
|
kapp->config()->writeEntry ("AreYouSure",settingData.areYouSure);
|
|
|
|
|
kapp->config()->writeEntry ("UseMainWindow",settingData.useMainWindow);
|
|
|
|
|
kapp->config()->writeEntry ("UseMessageWindow",settingData.useMessageWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kapp->config()->writeEntry ("Height",settingData.height); //
|
|
|
|
|
kapp->config()->writeEntry ("Width",settingData.width); //
|
|
|
|
|
kapp->config()->writeEntry ("PosY",settingData.y); //
|
|
|
|
|
kapp->config()->writeEntry ("PosX",settingData.x); //
|
|
|
|
|
kapp->config()->writeEntry ("PreviousMainWindow",settingData.activatedMainWindow);
|
|
|
|
|
tdeApp->config()->writeEntry ("AnalogFontColor",settingData.analogFontColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("AnalogScaleColor",settingData.analogScaleColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("AnalogErrorColor",settingData.analogErrorColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("AnalogWarnningColor",settingData.analogWarnningColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("AnalogOKColor",settingData.analogOKColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("AnalogFingerColor",settingData.analogFingerColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("APanelBackGroundColor",settingData.aPanelBackgroundColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("MPanelBackGroundColor",settingData.mPanelBackgroundColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("MainBackGroundColor",settingData.mainBackgroundColor);
|
|
|
|
|
tdeApp->config()->writeEntry ("NumberOfUpsRecords",upsCount);
|
|
|
|
|
tdeApp->config()->writeEntry ("CustomFont",settingData.customFont);
|
|
|
|
|
tdeApp->config()->writeEntry ("AnalogPanelFont",settingData.aPanelFont);
|
|
|
|
|
tdeApp->config()->writeEntry ("MainPanelFont",settingData.mPanelFont);
|
|
|
|
|
tdeApp->config()->writeEntry ("CustomBColor",(settingData.customBColor));
|
|
|
|
|
tdeApp->config()->writeEntry ("CustomBPanelColor",(settingData.customBPanelColor));
|
|
|
|
|
tdeApp->config()->writeEntry ("CustomBAnalogColor",(settingData.customBAnalogColor));
|
|
|
|
|
tdeApp->config()->writeEntry ("CustomOAnalogColor",(settingData.customOAnalogColor));
|
|
|
|
|
tdeApp->config()->writeEntry ("LowHighXfer",(settingData.lowHighXfer));
|
|
|
|
|
tdeApp->config()->writeEntry ("InputVoltage",(settingData.inputVoltage));
|
|
|
|
|
tdeApp->config()->writeEntry ("InputFrequency",(settingData.inputFrequency));
|
|
|
|
|
tdeApp->config()->writeEntry ("PanelFlags",(settingData.panelFlags | 3));
|
|
|
|
|
tdeApp->config()->writeEntry ("NumberOfCols",settingData.countCols);
|
|
|
|
|
tdeApp->config()->writeEntry ("UseDescription",settingData.useDescription);
|
|
|
|
|
tdeApp->config()->writeEntry ("AreYouSure",settingData.areYouSure);
|
|
|
|
|
tdeApp->config()->writeEntry ("UseMainWindow",settingData.useMainWindow);
|
|
|
|
|
tdeApp->config()->writeEntry ("UseMessageWindow",settingData.useMessageWindow);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tdeApp->config()->writeEntry ("Height",settingData.height); //
|
|
|
|
|
tdeApp->config()->writeEntry ("Width",settingData.width); //
|
|
|
|
|
tdeApp->config()->writeEntry ("PosY",settingData.y); //
|
|
|
|
|
tdeApp->config()->writeEntry ("PosX",settingData.x); //
|
|
|
|
|
tdeApp->config()->writeEntry ("PreviousMainWindow",settingData.activatedMainWindow);
|
|
|
|
|
|
|
|
|
|
if (all) {
|
|
|
|
|
for (int i=0; i<upsCount; i++) {
|
|
|
|
|
groupName.sprintf ("UPS %d",i);
|
|
|
|
|
kapp->config()->setGroup (groupName);
|
|
|
|
|
tdeApp->config()->setGroup (groupName);
|
|
|
|
|
upsRecords->get(i,upsData);
|
|
|
|
|
kapp->config()->writeEntry ("Port",upsData.port);
|
|
|
|
|
kapp->config()->writeEntry ("Delay",upsData.delay);
|
|
|
|
|
kapp->config()->writeEntry ("UpsAddress",upsData.upsAddress);
|
|
|
|
|
kapp->config()->writeEntry ("UpsName",upsData.upsName);
|
|
|
|
|
kapp->config()->writeEntry ("Name",upsData.name);
|
|
|
|
|
tdeApp->config()->writeEntry ("Port",upsData.port);
|
|
|
|
|
tdeApp->config()->writeEntry ("Delay",upsData.delay);
|
|
|
|
|
tdeApp->config()->writeEntry ("UpsAddress",upsData.upsAddress);
|
|
|
|
|
tdeApp->config()->writeEntry ("UpsName",upsData.upsName);
|
|
|
|
|
tdeApp->config()->writeEntry ("Name",upsData.name);
|
|
|
|
|
if (upsData.savePassword) {
|
|
|
|
|
kapp->config()->writeEntry ("UserName",upsData.userName);
|
|
|
|
|
kapp->config()->writeEntry ("Password",upsData.password);
|
|
|
|
|
tdeApp->config()->writeEntry ("UserName",upsData.userName);
|
|
|
|
|
tdeApp->config()->writeEntry ("Password",upsData.password);
|
|
|
|
|
}
|
|
|
|
|
kapp->config()->writeEntry ("SavePassword",upsData.savePassword);
|
|
|
|
|
tdeApp->config()->writeEntry ("SavePassword",upsData.savePassword);
|
|
|
|
|
for (int j=0; j < knc::NumberOfVars; j++) {
|
|
|
|
|
groupName.sprintf ("Var %d",j);
|
|
|
|
|
kapp->config()->writeEntry (groupName,upsData.upsVarCode[j]);
|
|
|
|
|
tdeApp->config()->writeEntry (groupName,upsData.upsVarCode[j]);
|
|
|
|
|
}
|
|
|
|
|
kapp->config()->setGroup ("");
|
|
|
|
|
tdeApp->config()->setGroup ("");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
kapp->config()->sync();
|
|
|
|
|
tdeApp->config()->sync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1144,7 +1144,7 @@ void KNutClient::exitMainWindow (void) {
|
|
|
|
|
delete m_mainUpsInfo.upsNet;
|
|
|
|
|
m_mainUpsInfo.upsNet = 0;
|
|
|
|
|
}
|
|
|
|
|
kapp->quit();
|
|
|
|
|
tdeApp->quit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1230,7 +1230,7 @@ void KNutClient::slotExitApplication(void) {
|
|
|
|
|
m_mainUpsInfo.upsNet = 0;
|
|
|
|
|
}
|
|
|
|
|
if (m_myDock) { m_myDock->close(); m_myDock = 0;}
|
|
|
|
|
kapp->quit();
|
|
|
|
|
tdeApp->quit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include "knutclient.moc"
|
|
|
|
|