25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kshutdown/kshutdown/links.h

75 lines
1.9 KiB

/*
links.h - A link creator/remover
Copyright (C) 2004 Konrad Twardowski <kdtonline@poczta.onet.pl>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __LINKS_H__
#define __LINKS_H__
#include <tqvbox.h>
class KPushButton;
class TQComboBox;
/** @short A link creator/remover. */
class Links: public TQVBox
{
TQ_OBJECT
public:
/**
* Constructor.
* @param parent A parent widget
*/
Links(TQWidget *parent);
/**
* Creates a new <b>.desktop</b> file.
* @param path A path to the <b>.desktop</b> file
* @param command A command to execute
* @param icon An icon name
* @param name A link name
* @param comment A comment
*/
static void createLink(
const TQString &path,
const TQString &command,
const TQString &icon,
const TQString &name,
const TQString &comment
);
/**
* Removes a <b>.desktop</b> file.
* @param path A <b>.desktop</b> file to remove
*/
static void removeLink(const TQString &path);
private:
KPushButton *b_addRemoveLink;
TQComboBox
*cb_location,
*cb_type;
TQString getCurrentLocationPath() const;
TQString getCurrentTypeCommand() const;
TQString getCurrentTypeIcon() const;
void updateAddRemoveButton();
private slots:
void slotActivated(int index);
void slotAddRemoveLink();
};
#endif // __LINKS_H__