KVIrc  4.9.2
DeveloperAPIs
OptionsWidget_mediaTypes.h
Go to the documentation of this file.
1 #ifndef _OPTW_MEDIATYPES_H_
2 #define _OPTW_MEDIATYPES_H_
3 //=============================================================================
4 //
5 // File : OptionsWidget_mediaTypes.h
6 // Creation date : Sat Jan 20 2001 16:12:10 CEST by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
27 #include "KviOptionsWidget.h"
28 #include "KviMediaManager.h"
29 
30 #include <QTreeWidget>
31 #include <QLineEdit>
32 #include <QPushButton>
33 
34 class MediaTypeTreeWidgetItem : public QTreeWidgetItem
35 {
36 public:
37  MediaTypeTreeWidgetItem(QTreeWidget * w, KviMediaType * t);
39 
40 private:
42 
43 public:
44  void copyData(KviMediaType * t);
45  const KviMediaType * mydata() { return &m_data; };
46 };
47 
48 #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_mediaTypes KviIconManager::File
49 #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_mediaTypes __tr2qs_no_lookup("Media Types")
50 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_mediaTypes OptionsWidget_general
51 #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_mediaTypes __tr2qs_no_lookup("file,audio,video,programs")
52 #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_mediaTypes 60000
53 //#define KVI_OPTIONS_WIDGET_HIDDEN_OptionsWidget_mediaTypes true
54 
56 {
57  Q_OBJECT
58 public:
59  OptionsWidget_mediaTypes(QWidget * parent);
61 
62 private:
63  QTreeWidget * m_pTreeWidget;
64  QLineEdit * m_pDescription;
65  QLineEdit * m_pIanaType;
66  QLineEdit * m_pFileMask;
67  QLineEdit * m_pSavePath;
68  QLineEdit * m_pCommandline;
69  QLineEdit * m_pMagicBytes;
71  QLineEdit * m_pIcon;
72  QPushButton * m_pDelete;
74 
75 private:
76  void fillTreeWidget();
77  void saveLastItem();
78  void enableOrDisable();
79  void setLineEdits();
80 private slots:
81  void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev);
82  void newMediaType();
83  void delMediaType();
84 
85 public:
86  virtual void commit();
87 };
88 
89 #endif
QLineEdit * m_pSavePath
Definition: OptionsWidget_mediaTypes.h:67
void setLineEdits()
Definition: OptionsWidget_mediaTypes.cpp:203
QLineEdit * m_pFileMask
Definition: OptionsWidget_mediaTypes.h:66
MediaTypeTreeWidgetItem * m_pLastItem
Definition: OptionsWidget_mediaTypes.h:73
void fillTreeWidget()
Definition: OptionsWidget_mediaTypes.cpp:156
Definition: OptionsWidget_mediaTypes.h:34
QLineEdit * m_pMagicBytes
Definition: OptionsWidget_mediaTypes.h:69
QLineEdit * m_pRemoteExecCommandline
Definition: OptionsWidget_mediaTypes.h:70
void enableOrDisable()
Definition: OptionsWidget_mediaTypes.cpp:190
QLineEdit * m_pCommandline
Definition: OptionsWidget_mediaTypes.h:68
Definition: KviOptionsWidget.h:40
OptionsWidget_mediaTypes(QWidget *parent)
Definition: OptionsWidget_mediaTypes.cpp:66
QLineEdit * m_pIcon
Definition: OptionsWidget_mediaTypes.h:71
void newMediaType()
Definition: OptionsWidget_mediaTypes.cpp:228
Definition: KviMediaType.h:50
const KviMediaType * mydata()
Definition: OptionsWidget_mediaTypes.h:45
Definition: OptionsWidget_mediaTypes.h:55
QHashIterator< int, QFile * > t(getDict)
MediaTypeTreeWidgetItem(QTreeWidget *w, KviMediaType *t)
Definition: OptionsWidget_mediaTypes.cpp:49
#define w
Definition: detector.cpp:87
void copyData(KviMediaType *t)
Definition: OptionsWidget_mediaTypes.cpp:58
virtual void commit()
Definition: OptionsWidget_mediaTypes.cpp:247
void saveLastItem()
Definition: OptionsWidget_mediaTypes.cpp:169
QTreeWidget * m_pTreeWidget
Definition: OptionsWidget_mediaTypes.h:63
QPushButton * m_pDelete
Definition: OptionsWidget_mediaTypes.h:72
KviMediaType m_data
Definition: OptionsWidget_mediaTypes.h:41
void currentItemChanged(QTreeWidgetItem *it, QTreeWidgetItem *prev)
Definition: OptionsWidget_mediaTypes.cpp:215
void delMediaType()
Definition: OptionsWidget_mediaTypes.cpp:237
QLineEdit * m_pIanaType
Definition: OptionsWidget_mediaTypes.h:65
QLineEdit * m_pDescription
Definition: OptionsWidget_mediaTypes.h:64