Changeset View
Changeset View
Standalone View
Standalone View
backgroundselector.cpp
Show All 13 Lines | |||||
14 | * Library General Public License for more details. | 14 | * Library General Public License for more details. | ||
15 | * | 15 | * | ||
16 | * You should have received a copy of the GNU Library General Public | 16 | * You should have received a copy of the GNU Library General Public | ||
17 | * License along with KBounce; if not, write to the Free | 17 | * License along with KBounce; if not, write to the Free | ||
18 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
19 | * Boston, MA 02110-1301, USA. | 19 | * Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "backgroundselector.h" | | |||
23 | #include "ui_backgroundselector.h" | | |||
24 | | ||||
25 | #include <KColorScheme> | 22 | #include <KColorScheme> | ||
26 | #include <KLocalizedString> | 23 | #include <KLocalizedString> | ||
24 | #include <QPainter> | ||||
27 | 25 | | |||
28 | #include "renderer.h" | 26 | #include "renderer.h" | ||
29 | 27 | #include "backgroundselector.h" | |||
30 | #include <QPainter> | 28 | #include "ui_backgroundselector.h" | ||
31 | 29 | | |||
32 | BackgroundSelector::BackgroundSelector(QWidget* parent, KConfigSkeleton* config) : | 30 | BackgroundSelector::BackgroundSelector(QWidget* parent, KConfigSkeleton* config) : | ||
33 | QWidget(parent), | 31 | QWidget(parent), | ||
34 | ui(new Ui::KBounceBackgroundSelector),m_config(config) | 32 | ui(new Ui::KBounceBackgroundSelector),m_config(config) | ||
35 | { | 33 | { | ||
36 | ui->setupUi(this); | 34 | ui->setupUi(this); | ||
37 | setupData(); | 35 | setupData(); | ||
38 | } | 36 | } | ||
Show All 32 Lines | 59 | { | |||
71 | ui->kurlrequester->setUrl(QUrl(picturePath)); | 69 | ui->kurlrequester->setUrl(QUrl(picturePath)); | ||
72 | ui->kurlrequester->setStartDir(QUrl(picturePath)); | 70 | ui->kurlrequester->setStartDir(QUrl(picturePath)); | ||
73 | } | 71 | } | ||
74 | } | 72 | } | ||
75 | 73 | | |||
76 | void BackgroundSelector::useRandomBackgroundPicturesChanged(bool toggled) | 74 | void BackgroundSelector::useRandomBackgroundPicturesChanged(bool toggled) | ||
77 | { | 75 | { | ||
78 | if (toggled) | 76 | if (toggled) | ||
79 | { | | |||
80 | enableSettings(true); | | |||
81 | previewBackgroundPicture(); | 77 | previewBackgroundPicture(); | ||
82 | } | 78 | | ||
83 | else | 79 | enableSettings(toggled); | ||
84 | { | | |||
85 | enableSettings(false); | | |||
86 | } | | |||
87 | } | 80 | } | ||
88 | 81 | | |||
89 | void BackgroundSelector::enableSettings(bool enable) | 82 | void BackgroundSelector::enableSettings(bool enable) | ||
90 | { | 83 | { | ||
91 | ui->kurlrequester->setEnabled(enable); | 84 | ui->kurlrequester->setEnabled(enable); | ||
92 | ui->backgroundPicturePreview->setEnabled(enable); | 85 | ui->backgroundPicturePreview->setEnabled(enable); | ||
93 | } | 86 | } | ||
94 | 87 | | |||
Show All 31 Lines |