2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
10 #ifndef BACKGROUNDDIALOG_H
11 #define BACKGROUNDDIALOG_H
17 #include "backgroundpackage.h"
18 #include "renderthread.h"
20 #include "ui_BackgroundDialog.h"
22 class BackgroundContainer
;
24 class BackgroundListModel
;
35 class BackgroundDialog
: public KDialog
, public Ui::BackgroundDialog
45 // FIXME seems that we're leaking, make a distructor
46 BackgroundDialog(const QSize
&res
,
47 const KConfigGroup
&config
,
48 const KConfigGroup
&globalConfig
,
51 void reloadConfig(const KConfigGroup
&config
, const KConfigGroup
&globalConfig
);
52 void saveConfig(KConfigGroup config
, KConfigGroup globalConfig
);
59 BackgroundListModel
*m_model
;
60 ThemeModel
*m_themeModel
;
62 //QLabel *m_authorLabel;
63 //QLabel *m_emailLabel;
64 //QLabel *m_licenseLabel;
65 //QLabel *m_authorLine;
66 //QLabel *m_emailLine;
67 //QLabel *m_licenseLine;
70 //QPushButton *m_newStuff;
72 //QComboBox *m_resizeMethod;
73 //KColorButton *m_color;
75 //QListWidget *m_dirlist;
76 //QPushButton *m_addDir;
77 //QPushButton *m_removeDir;
78 //QTimeEdit *m_slideshowDelay;
79 KFileDialog
*m_dialog
;
85 QTimer m_preview_timer
;
86 QList
<Background
*> m_slideshowBackgrounds
;
89 QStringList m_selected
;
91 RenderThread m_preview_renderer
;
94 //QCheckBox *m_alignToGrid;
95 //QCheckBox *m_showIcons;
97 bool setMetadata(QLabel
*label
,
99 void setPreview(const QString
&img
, Background::ResizeMethod method
);
100 virtual bool contains(const QString
&path
) const;
105 void showFileDialog();
106 void enableButtons(bool enabled
);
109 void slotRemoveDir();
110 void updateSlideshow();
111 void updateSlideshowPreview();
113 void changeBackgroundMode(int mode
);
114 void previewRenderingDone(int token
, const QImage
&pix
);
116 void updateScreenshot(QPersistentModelIndex index
);
118 void removeBackground(const QString
&path
);
121 #endif // BACKGROUNDDIALOG_H