KShutdown – graphical shutdown utility
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.

77 lines
1.9KB

  1. /*
  2. mactioneditsdialog.h - An action editor
  3. Copyright (C) 2003 Konrad Twardowski <kdtonline@poczta.onet.pl>
  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. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. */
  16. #ifndef __MACTIONEDITDIALOG_H__
  17. #define __MACTIONEDITDIALOG_H__
  18. #include "actions.h"
  19. #include <kdialogbase.h>
  20. class TQCheckBox;
  21. class TQComboBox;
  22. class KIntNumInput;
  23. class KLineEdit;
  24. class KPushButton;
  25. /**
  26. * @short An action editor.
  27. * Used in @ref MSettingsDialog.
  28. */
  29. class MActionEditDialog: public KDialogBase
  30. {
  31. Q_OBJECT
  32. public:
  33. /**
  34. * Constructor.
  35. * @param parent A parent widget
  36. * @param action An action type to edit
  37. */
  38. MActionEditDialog(TQWidget *parent, const Action::Type action);
  39. /** Destructor. */
  40. virtual ~MActionEditDialog();
  41. private:
  42. Action::Type _action;
  43. TQComboBox *_methods;
  44. TQLabel
  45. *l_command,
  46. *l_title;
  47. TQString _userCommand;
  48. KLineEdit *in_command;
  49. // command before action
  50. TQCheckBox *c_runCommandBeforeAction;
  51. KLineEdit *i_commandBeforeAction;
  52. KIntNumInput *i_commandBeforeActionPause;
  53. KPushButton *b_testCommandBeforeAction;
  54. void setMethod(const Action::Method method) const;
  55. protected slots:
  56. /**
  57. * Sets default values.
  58. */
  59. virtual void slotDefault();
  60. private slots:
  61. void slotMethodChange(int index);
  62. void slotOKClicked();
  63. void slotTestCommandBeforeAction();
  64. };
  65. #endif // __MACTIONEDITDIALOG_H__