summaryrefslogtreecommitdiffstats
path: root/khotkeys/kcontrol/menuentry_widget.cpp
blob: 9b313d20d58893b93786db0ef0cac3e32c9a7c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/****************************************************************************

 KHotKeys
 
 Copyright (C) 1999-2001 Lubos Lunak <l.lunak@kde.org>

 Distributed under the terms of the GNU General Public License version 2.
 
****************************************************************************/

#define _MENUENTRY_WIDGET_CPP_

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include "menuentry_widget.h"

#include <tqpushbutton.h>
#include <tqlineedit.h>
#include <tqcheckbox.h>
#include <tqgroupbox.h>

#include <kdebug.h>

#include <actions.h>
#include <action_data.h>

#include "windowdef_list_widget.h"
#include "kcmkhotkeys.h"

namespace KHotKeys
{

Menuentry_widget::Menuentry_widget( TQWidget* parent_P, const char* name_P )
    : Menuentry_widget_ui( parent_P, name_P )
    {
    clear_data();
    // KHotKeys::Module::changed()
    connect( menuentry_lineedit, TQT_SIGNAL( textChanged( const TQString& )),
        module, TQT_SLOT( changed()));
    }

void Menuentry_widget::clear_data()
    {
    menuentry_lineedit->clear();
    }

void Menuentry_widget::set_data( const Menuentry_action* data_P )
    {
    if( data_P == NULL )
        {
        clear_data();
        return;
        }
    menuentry_lineedit->setText( data_P->command_url());
    }

Menuentry_action* Menuentry_widget::get_data( Action_data* data_P ) const
    {
    return new Menuentry_action( data_P, menuentry_lineedit->text());
    }

void Menuentry_widget::browse_pressed()
    { // CHECKME TODO
    }
    
} // namespace KHotKeys

#include "menuentry_widget.moc"