VersionedSaveDialog.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * VersionedSaveDialog.h - declaration of class VersionedSaveDialog, a file save
  3. * dialog that provides buttons to increment or decrement a version which is
  4. * appended to the file name. (e.g. "MyProject-01.mmpz")
  5. *
  6. * Copyright (c) 2014 Lukas W <lukaswhl/at/gmail.com>
  7. *
  8. * This file is part of LMMS - https://lmms.io
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2 of the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public
  21. * License along with this program (see COPYING); if not, write to the
  22. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  23. * Boston, MA 02110-1301 USA.
  24. *
  25. */
  26. #ifndef VERSIONEDSAVEDIALOG_H
  27. #define VERSIONEDSAVEDIALOG_H
  28. #include "FileDialog.h"
  29. #include "Song.h"
  30. class QLineEdit;
  31. class LedCheckBox;
  32. class SaveOptionsWidget : public QWidget {
  33. public:
  34. SaveOptionsWidget(Song::SaveOptions &saveOptions);
  35. private:
  36. LedCheckBox *m_discardMIDIConnectionsCheckbox;
  37. LedCheckBox *m_saveAsProjectBundleCheckbox;
  38. };
  39. class VersionedSaveDialog : public FileDialog
  40. {
  41. Q_OBJECT
  42. public:
  43. explicit VersionedSaveDialog( QWidget *parent = 0,
  44. QWidget *saveOptionsWidget = nullptr,
  45. const QString &caption = QString(),
  46. const QString &directory = QString(),
  47. const QString &filter = QString() );
  48. // Returns true if file name was changed, returns false if it wasn't
  49. static bool changeFileNameVersion( QString &fileName, bool increment );
  50. static bool fileExistsQuery( QString FileName, QString WindowTitle );
  51. public slots:
  52. void incrementVersion();
  53. void decrementVersion();
  54. };
  55. #endif // VERSIONEDSAVEDIALOG_H