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.

75 lines
1.9KB

  1. /*
  2. links.h - A link creator/remover
  3. Copyright (C) 2004 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 __LINKS_H__
  17. #define __LINKS_H__
  18. #include <tqvbox.h>
  19. class KPushButton;
  20. class TQComboBox;
  21. /** @short A link creator/remover. */
  22. class Links: public TQVBox
  23. {
  24. Q_OBJECT
  25. public:
  26. /**
  27. * Constructor.
  28. * @param parent A parent widget
  29. */
  30. Links(TQWidget *parent);
  31. /**
  32. * Creates a new <b>.desktop</b> file.
  33. * @param path A path to the <b>.desktop</b> file
  34. * @param command A command to execute
  35. * @param icon An icon name
  36. * @param name A link name
  37. * @param comment A comment
  38. */
  39. static void createLink(
  40. const TQString &path,
  41. const TQString &command,
  42. const TQString &icon,
  43. const TQString &name,
  44. const TQString &comment
  45. );
  46. /**
  47. * Removes a <b>.desktop</b> file.
  48. * @param path A <b>.desktop</b> file to remove
  49. */
  50. static void removeLink(const TQString &path);
  51. private:
  52. KPushButton *b_addRemoveLink;
  53. TQComboBox
  54. *cb_location,
  55. *cb_type;
  56. TQString getCurrentLocationPath() const;
  57. TQString getCurrentTypeCommand() const;
  58. TQString getCurrentTypeIcon() const;
  59. void updateAddRemoveButton();
  60. private slots:
  61. void slotActivated(int index);
  62. void slotAddRemoveLink();
  63. };
  64. #endif // __LINKS_H__