summaryrefslogtreecommitdiffstats
path: root/kopete/libkopete/ui/kopetestdaction.cpp
blob: 5a589293f137ef69154ca0bcc0cd4cf8037f1d74 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
    kopetestdaction.cpp  -  Kopete Standard Actionds

    Copyright (c) 2001-2002 by Ryan Cumming          <ryan@kde.org>
    Copyright (c) 2002-2003 by Martijn Klingens      <klingens@kde.org>

    Kopete    (c) 2001-2003 by the Kopete developers <kopete-devel@kde.org>

    *************************************************************************
    *                                                                       *
    * This library is free software; you can redistribute it and/or         *
    * modify it under the terms of the GNU Lesser General Public            *
    * License as published by the Free Software Foundation; either          *
    * version 2 of the License, or (at your option) any later version.      *
    *                                                                       *
    *************************************************************************
*/

#include "kopetestdaction.h"

#include <tqapplication.h>

#include <kdebug.h>
#include <tdeversion.h>
#include <kguiitem.h>
#include <klocale.h>
#include <ksettings/dialog.h>
#include <kstdaction.h>
#include <kstdguiitem.h>
#include <twin.h>
#include <kcmultidialog.h>

#include "kopetecontactlist.h"
#include "kopetegroup.h"
#include "kopeteuiglobal.h"

KSettings::Dialog *KopetePreferencesAction::s_settingsDialog = 0L;

KopetePreferencesAction::KopetePreferencesAction( TDEActionCollection *parent, const char *name )
#if KDE_IS_VERSION( 3, 3, 90 )
: TDEAction( KStdGuiItem::configure(), 0, 0, 0, parent, name )
#else
: TDEAction( KGuiItem( i18n( "&Configure Kopete..." ),
	TQString::fromLatin1( "configure" ) ), 0, 0, 0, parent, name )
#endif
{
	connect( this, TQT_SIGNAL( activated() ), this, TQT_SLOT( slotShowPreferences() ) );
}

KopetePreferencesAction::~KopetePreferencesAction()
{
}

void KopetePreferencesAction::slotShowPreferences()
{
	// FIXME: Use static deleter - Martijn
	if ( !s_settingsDialog )
		s_settingsDialog = new KSettings::Dialog( KSettings::Dialog::Static, Kopete::UI::Global::mainWidget() );
	s_settingsDialog->show();

	s_settingsDialog->dialog()->raise();

	KWin::activateWindow( s_settingsDialog->dialog()->winId() );
}

TDEAction * KopeteStdAction::preferences( TDEActionCollection *parent, const char *name )
{
	return new KopetePreferencesAction( parent, name );
}

TDEAction * KopeteStdAction::chat( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "Start &Chat..." ), TQString::fromLatin1( "mail_generic" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::sendMessage( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "&Send Single Message..." ), TQString::fromLatin1( "mail_generic" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::contactInfo( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "User &Info" ), TQString::fromLatin1( "messagebox_info" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::sendFile( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "Send &File..." ), TQString::fromLatin1( "attach" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::viewHistory( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "View &History..." ), TQString::fromLatin1( "history" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::addGroup( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "&Create Group..." ), TQString::fromLatin1( "folder" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::changeMetaContact( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "Cha&nge Meta Contact..." ), TQString::fromLatin1( "move" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::deleteContact( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "&Delete Contact" ), TQString::fromLatin1( "delete_user" ), TQt::Key_Delete, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::changeAlias( const TQObject *recvr, const char *slot, TQObject *parent, const char *name )
{
	return new TDEAction( i18n( "Change A&lias..." ), TQString::fromLatin1( "signature" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::blockContact( const TQObject *recvr, const char *slot, TQObject* parent, const char *name )
{
	return new TDEAction( i18n( "&Block Contact" ), TQString::fromLatin1( "player_pause" ), 0, recvr, slot, parent, name );
}

TDEAction * KopeteStdAction::unblockContact( const TQObject *recvr, const char *slot, TQObject* parent, const char *name )
{
	return new TDEAction( i18n( "Un&block Contact" ), TQString::fromLatin1( "player_play" ), 0, recvr, slot, parent, name );
}

#include "kopetestdaction.moc"

// vim: set noet ts=4 sts=4 sw=4: