VersionedSaveDialog.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. };
  38. class VersionedSaveDialog : public FileDialog
  39. {
  40. Q_OBJECT
  41. public:
  42. explicit VersionedSaveDialog( QWidget *parent = 0,
  43. QWidget *saveOptionsWidget = nullptr,
  44. const QString &caption = QString(),
  45. const QString &directory = QString(),
  46. const QString &filter = QString() );
  47. // Returns true if file name was changed, returns false if it wasn't
  48. static bool changeFileNameVersion( QString &fileName, bool increment );
  49. static bool fileExistsQuery( QString FileName, QString WindowTitle );
  50. public slots:
  51. void incrementVersion();
  52. void decrementVersion();
  53. };
  54. #endif // VERSIONEDSAVEDIALOG_H