瀏覽代碼

small fix for the apply button to stay active after applying changes

maldela 7 年之前
父節點
當前提交
7ac9f55c00
共有 2 個文件被更改,包括 5 次插入4 次删除
  1. 3 0
      import/src/guibase.cpp
  2. 2 4
      import/src/systemdcommunicator.cpp

+ 3 - 0
import/src/guibase.cpp

@@ -186,10 +186,13 @@ void GUIBase::apply()
 
 
     bool configChanged = m_loader->save();
     bool configChanged = m_loader->save();
     m_config->save();
     m_config->save();
+    m_configChanged = false;
 
 
 #ifndef NO_SYSTEMD
 #ifndef NO_SYSTEMD
     m_com->apply(configChanged);
     m_com->apply(configChanged);
 #endif
 #endif
+
+    emit needsApplyChanged();
 }
 }
 
 
 void GUIBase::reset()
 void GUIBase::reset()

+ 2 - 4
import/src/systemdcommunicator.cpp

@@ -31,7 +31,6 @@
 #include <KAuth/KAuthExecuteJob>
 #include <KAuth/KAuthExecuteJob>
 #include <KI18n/KLocalizedString>
 #include <KI18n/KLocalizedString>
 
 
-
 #ifndef STANDARD_SERVICE_NAME
 #ifndef STANDARD_SERVICE_NAME
 #define STANDARD_SERVICE_NAME "fancontrol"
 #define STANDARD_SERVICE_NAME "fancontrol"
 #endif
 #endif
@@ -152,6 +151,7 @@ void SystemdCommunicator::setServiceName(const QString &name)
 
 
         emit serviceEnabledChanged();
         emit serviceEnabledChanged();
         emit serviceActiveChanged();
         emit serviceActiveChanged();
+        emit needsApplyChanged();
     }
     }
 }
 }
 
 
@@ -250,7 +250,6 @@ bool SystemdCommunicator::restartService()
         return dbusAction(QStringLiteral("ReloadOrRestartUnit"), args);
         return dbusAction(QStringLiteral("ReloadOrRestartUnit"), args);
     }
     }
 
 
-    emit error(i18n("Service does not exist: \'%1\'", m_serviceName));
     return false;
     return false;
 }
 }
 
 
@@ -291,9 +290,8 @@ bool SystemdCommunicator::dbusAction(const QString &method, const QVariantList &
         }
         }
     }
     }
     else
     else
-    {
         emit error(i18n("Dbus error: %1", job->errorString()));
         emit error(i18n("Dbus error: %1", job->errorString()));
-    }
+
     return success;
     return success;
 }
 }