KOffice – TDE office suite
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.7KB

  1. /*
  2. * Copyright (c) 2002, 2003 Patrick Julien <freak@codepimps.org>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  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. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. */
  18. #include <tqwidget.h>
  19. #include <tqstring.h>
  20. #include <kaction.h>
  21. #include <tqlabel.h>
  22. #include <klocale.h>
  23. #include <kdebug.h>
  24. #include "kis_tool.h"
  25. #include "kis_tool.moc"
  26. class KisTool::KisToolPrivate
  27. {
  28. public:
  29. TQString uiname;
  30. TQLabel * optionWidget;
  31. };
  32. KisTool::KisTool(const TQString & name)
  33. {
  34. m_action = 0;
  35. m_ownAction = false;
  36. d = new KisToolPrivate();
  37. d->uiname = name;
  38. d->optionWidget = 0;
  39. }
  40. KisTool::~KisTool()
  41. {
  42. if (m_ownAction) {
  43. delete m_action;
  44. m_action = 0;
  45. }
  46. delete d;
  47. }
  48. TQWidget* KisTool::createOptionWidget(TQWidget* parent)
  49. {
  50. d->optionWidget = new TQLabel(i18n("No options for %1.").tqarg(d->uiname), parent);
  51. d->optionWidget->setCaption(d->uiname);
  52. d->optionWidget->setAlignment(TQt::AlignCenter);
  53. return d->optionWidget;
  54. }
  55. TQWidget* KisTool::optionWidget()
  56. {
  57. return d->optionWidget;
  58. }