sessionsetupmanager.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 SESSIONSETUPMANAGER_H
  21. #define SESSIONSETUPMANAGER_H
  22. class MainWindow;
  23. #include "starpu_top_types.h"
  24. #include <QSettings>
  25. static const QString SESSION_SETUPS_DIR = "./sessionsetups";
  26. static const QString SESSION_SETUPS_FILEEXT = ".ses";
  27. class SessionSetupManager: public QObject
  28. { /* Saves and loads a session setup. The session setup
  29. includes the geometries and states of the widget windows
  30. and the descriptions of the data and the parameters. */
  31. Q_OBJECT
  32. public:
  33. SessionSetupManager(MainWindow *mainWindow);
  34. ~SessionSetupManager();
  35. private:
  36. // Data
  37. MainWindow *_mainWindow;
  38. QSettings *_sessionStateSettings;
  39. public slots:
  40. bool saveSessionSetup(QString sessionSetupName);
  41. bool loadSessionSetup(QString sessionSetupName);
  42. signals:
  43. void descriptionsSetupLoaded(
  44. QList<DataDescriptionSetup> dataDescriptionsSetup,
  45. QList<ParamDescriptionSetup> paramDescriptionsSetup);
  46. void mainWindowSetupLoaded(MainWindowSetup mainWindowSetup);
  47. void parametersDockSetupLoaded(ParametersDockSetup parametersDockSetup);
  48. void widgetWindowsSetupLoaded(QList<DataWidgetSetup> dataWidgetsSetup,
  49. QList<DataAggregatorWidgetSetup> dataAggregatorWidgetsSetup);
  50. };
  51. #endif // SESSIONSETUPMANAGER_H