configurationmanager.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. = StarPU-Top for StarPU =
  3. Copyright (C) 2011
  4. William Braik
  5. Yann Courtois
  6. Jean-Marie Couteyen
  7. Anthony Roy
  8. This library is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU Lesser General Public
  10. License as published by the Free Software Foundation; either
  11. version 2.1 of the License, or (at your option) any later version.
  12. This library is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. Lesser General Public License for more details.
  16. You should have received a copy of the GNU Lesser General Public
  17. License along with this library; if not, write to the Free Software
  18. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef CONFIGURATIONMANAGER_H
  21. #define CONFIGURATIONMANAGER_H
  22. #include <QSettings>
  23. static const QString CONFIG_FILE_DIR = ".";
  24. static const QString CONFIG_FILE_NAME = "starpu_top.cfg";
  25. class ConfigurationManager
  26. { /* Contains and manages all the application settings
  27. of the current instance, and remembers them for use
  28. in the next instances */
  29. public:
  30. ConfigurationManager();
  31. ~ConfigurationManager();
  32. // Getters
  33. QString serverHost() const;
  34. int serverPort() const;
  35. bool ssh() const;
  36. QString commandLine() const;
  37. bool antialiasing() const;
  38. // Setters
  39. void setServerHost(QString serverIP);
  40. void setServerPort(int serverPort);
  41. void setSSH(bool enabled);
  42. void setCommandLine(QString commandLine);
  43. void setAntialiasing(bool enabled);
  44. // Other methods
  45. void syncConfiguration();
  46. private:
  47. // Data
  48. QSettings *_applicationSettings;
  49. };
  50. #endif // CONFIGURATIONMANAGER_H