1 /* This file is part of the KDE project
3 Copyright (C) 2005 Dario Massarin <nekkar@libero.it>
4 Copyright (C) 2007 Urs Wolfer <uwolfer @ kde.org>
5 Copyright (C) 2007 Javier Goday <jgoday @ gmail.com>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
13 #ifndef TRANSFERS_GROUP_WIDGET_H
14 #define TRANSFERS_GROUP_WIDGET_H
18 #include <QStyledItemDelegate>
19 #include <QVBoxLayout>
26 class GroupEditor
: public KLineEdit
30 GroupEditor(QModelIndex group
, const QString contents
, QWidget
* parent
=0)
31 : KLineEdit(contents
, parent
), m_groupIndex(group
)
35 QModelIndex
groupIndex() const {return m_groupIndex
;}
38 QModelIndex m_groupIndex
;
41 class TransfersGroupDelegate
: public QStyledItemDelegate
45 TransfersGroupDelegate(QObject
* parent
=0);
47 QWidget
* createEditor(QWidget
* parent
, const QStyleOptionViewItem
& option
, const QModelIndex
& index
) const;
50 class TransfersGroupTree
: public QTreeView
54 TransfersGroupTree(QWidget
*parent
=0);
59 void deleteSelectedGroup();
60 void renameSelectedGroup();
61 void changeIcon(const QString
&icon
);
62 void commitData(QWidget
*editor
);
65 class TransfersGroupWidget
: public QVBoxLayout
69 TransfersGroupWidget(QWidget
*parent
=0);
72 void slotSelectionChanged(const QItemSelection
¤t
, const QItemSelection
&old
);
75 TransfersGroupTree
*m_view
;
77 QPushButton
*addButton
;
78 QPushButton
*deleteButton
;
79 QPushButton
*renameButton
;
80 KIconButton
*iconButton
;
81 QPushButton
*configureButton
;