VersionedSaveDialog.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. class QLineEdit;
  30. class VersionedSaveDialog : public FileDialog
  31. {
  32. Q_OBJECT
  33. public:
  34. explicit VersionedSaveDialog( QWidget *parent = 0,
  35. const QString &caption = QString(),
  36. const QString &directory = QString(),
  37. const QString &filter = QString() );
  38. // Returns true if file name was changed, returns false if it wasn't
  39. static bool changeFileNameVersion( QString &fileName, bool increment );
  40. static bool fileExistsQuery( QString FileName, QString WindowTitle );
  41. public slots:
  42. void incrementVersion();
  43. void decrementVersion();
  44. };
  45. #endif // VERSIONEDSAVEDIALOG_H