1 //
2 // C++ Interface: optionseditor
3 //
4 // Description:
5 //
6 //
7 // Author: Daniel Faust <hessijames@gmail.com>, (C) 2008
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 #ifndef OPTIONSEDITOR_H
13 #define OPTIONSEDITOR_H
14 
15 // #include <KPageWidget>
16 #include <KPageDialog>
17 #include <qlayout.h>
18 
19 class Options;
20 class Config;
21 class TagEngine;
22 // class ConversionOptions;
23 
24 class KLineEdit;
25 class KComboBox;
26 class KIntSpinBox;
27 class KTextEdit;
28 class KPushButton;
29 class QLabel;
30 class FileListItem;
31 
32 /**
33 	@author Daniel Faust <hessijames@gmail.com>
34 */
35 class OptionsEditor : public KPageDialog
36 {
37     Q_OBJECT
38 public:
39     OptionsEditor( Config *_config, QWidget *parent );
40     ~OptionsEditor();
41 
42 private:
43     void setTagInputEnabled( bool enabled );
44 
45     /** The widget, where we can set our output options */
46     Options *options;
47 
48     /** A list of all covers */
49     QLabel* lCoversLabel;
50     QHBoxLayout *bCovers;
51     QList<QLabel*> lCovers;
52     /** A lineedit for entering the title of track */
53     QLabel* lTitleLabel;
54     KLineEdit* lTitle;
55     KPushButton* pTitleEdit;
56     /** A spinbox for entering or selecting the track number */
57     QLabel* lTrackLabel;
58     KIntSpinBox* iTrack;
59     KPushButton* pTrackEdit;
60     /** A spinbox for entering or selecting the total track number */
61     QLabel* lTrackTotalLabel;
62     KIntSpinBox* iTrackTotal;
63     KPushButton* pTrackTotalEdit;
64     /** A lineedit for entering the artist of a track */
65     QLabel* lArtistLabel;
66     KLineEdit* lArtist;
67     KPushButton* pArtistEdit;
68     /** A lineedit for entering the composer of a track */
69     QLabel* lComposerLabel;
70     KLineEdit* lComposer;
71     KPushButton* pComposerEdit;
72     /** A lineedit for entering the album artist */
73     QLabel* lAlbumArtistLabel;
74     KLineEdit* lAlbumArtist;
75     KPushButton* pAlbumArtistEdit;
76     /** A lineedit for entering the album name */
77     QLabel* lAlbumLabel;
78     KLineEdit* lAlbum;
79     KPushButton* pAlbumEdit;
80     /** A spinbox for entering or selecting the disc number */
81     QLabel* lDiscLabel;
82     KIntSpinBox* iDisc;
83     KPushButton* pDiscEdit;
84     /** A spinbox for entering or selecting the total disc number */
85     QLabel* lDiscTotalLabel;
86     KIntSpinBox* iDiscTotal;
87     KPushButton* pDiscTotalEdit;
88     /** A spinbox for entering or selecting the year of the album */
89     QLabel* lYearLabel;
90     KIntSpinBox* iYear;
91     KPushButton* pYearEdit;
92     /** A combobox for entering or selecting the genre of the album */
93     QLabel* lGenreLabel;
94     KComboBox* cGenre;
95     KPushButton* pGenreEdit;
96     /** A textedit for entering a comment for a track */
97     QLabel* lCommentLabel;
98     KTextEdit* tComment;
99     KPushButton* pCommentEdit;
100 
101     /** When hitting this button, the options lock (when multiple files are selected) will be deactivated */
102     QLabel* lEditOptions;
103     KPushButton* pEditOptions;
104 
105     /** When hitting this button, the tag lock (when reading tags failed) will be deactivated */
106     QLabel* lEditTags;
107     KPushButton* pEditTags;
108 
109     QList<FileListItem*> selectedItems;
110 
111     Config *config;
112     TagEngine *tagEngine;
113 
114     QPushButton *nextButton;
115     QPushButton *prevButton;
116 
117 public slots:
118     // connected to FileList
119     void itemsSelected( QList<FileListItem*> );
120     void setPreviousEnabled( bool );
121     void setNextEnabled( bool );
122 
123 private slots:
124     void applyChanges();
125 
126     void editOptionsClicked();
127     void editTagsClicked();
128 
129     void editTitleClicked();
130     void editTrackClicked();
131     void editTrackTotalClicked();
132     void editArtistClicked();
133     void editComposerClicked();
134     void editAlbumArtistClicked();
135     void editAlbumClicked();
136     void editDiscClicked();
137     void editDiscTotalClicked();
138     void editYearClicked();
139     void editGenreClicked();
140     void editCommentClicked();
141 
142 signals:
143     // connected to FileList
144     void updateFileListItems( QList<FileListItem*> items );
145 
146 };
147 
148 #endif
149