ccGraphicalSegmentationOptionsDlg.cpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //##########################################################################
  2. //# #
  3. //# CLOUDCOMPARE #
  4. //# #
  5. //# This program is free software; you can redistribute it and/or modify #
  6. //# it under the terms of the GNU General Public License as published by #
  7. //# the Free Software Foundation; version 2 or later of the License. #
  8. //# #
  9. //# This program is distributed in the hope that it will be useful, #
  10. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  11. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  12. //# GNU General Public License for more details. #
  13. //# #
  14. //# COPYRIGHT: CloudCompare project #
  15. //# #
  16. //##########################################################################
  17. // Local
  18. #include "ccGraphicalSegmentationOptionsDlg.h"
  19. //Qt
  20. #include <QSettings>
  21. ccGraphicalSegmentationOptionsDlg::ccGraphicalSegmentationOptionsDlg(const QString windowTitle/*=QString()*/,
  22. QWidget* parent/*=nullptr*/)
  23. : QDialog(parent, Qt::Tool)
  24. , Ui::GraphicalSegmentationOptionsDlg()
  25. {
  26. setupUi(this);
  27. QSettings settings;
  28. settings.beginGroup(SegmentationToolOptionsKey());
  29. QString remainingSuffix = settings.value(RemainingSuffixKey(), ".remaining").toString();
  30. QString segmentedSuffix = settings.value(SegmentedSuffixKey(), ".segmented").toString();
  31. settings.endGroup();
  32. remainingTextLineEdit->setText(remainingSuffix);
  33. segmentedTextLineEdit->setText(segmentedSuffix);
  34. if (!windowTitle.isEmpty())
  35. {
  36. setWindowTitle(windowTitle);
  37. }
  38. }
  39. void ccGraphicalSegmentationOptionsDlg::accept()
  40. {
  41. QSettings settings;
  42. settings.beginGroup(SegmentationToolOptionsKey());
  43. settings.setValue(RemainingSuffixKey(), remainingTextLineEdit->text());
  44. settings.setValue(SegmentedSuffixKey(), segmentedTextLineEdit->text());
  45. settings.endGroup();
  46. QDialog::accept();
  47. }