Changeset View
Changeset View
Standalone View
Standalone View
krusader/BookMan/kraddbookmarkdlg.cpp
Show All 15 Lines | |||||
16 | * GNU General Public License for more details. * | 16 | * GNU General Public License for more details. * | ||
17 | * * | 17 | * * | ||
18 | * You should have received a copy of the GNU General Public License * | 18 | * You should have received a copy of the GNU General Public License * | ||
19 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | 19 | * along with Krusader. If not, see [http://www.gnu.org/licenses/]. * | ||
20 | *****************************************************************************/ | 20 | *****************************************************************************/ | ||
21 | 21 | | |||
22 | #include "kraddbookmarkdlg.h" | 22 | #include "kraddbookmarkdlg.h" | ||
23 | #include "../krglobal.h" | 23 | #include "../krglobal.h" | ||
24 | #include "../icon.h" | ||||
24 | #include "krbookmarkhandler.h" | 25 | #include "krbookmarkhandler.h" | ||
25 | 26 | | |||
26 | // QtWidgets | 27 | // QtWidgets | ||
27 | #include <QDialogButtonBox> | 28 | #include <QDialogButtonBox> | ||
28 | #include <QHeaderView> | 29 | #include <QHeaderView> | ||
29 | #include <QGridLayout> | 30 | #include <QGridLayout> | ||
30 | #include <QInputDialog> | 31 | #include <QInputDialog> | ||
31 | #include <QLabel> | 32 | #include <QLabel> | ||
32 | #include <QPushButton> | 33 | #include <QPushButton> | ||
33 | 34 | | |||
34 | #include <KI18n/KLocalizedString> | 35 | #include <KI18n/KLocalizedString> | ||
35 | #include <KIconThemes/KIconLoader> | 36 | | ||
36 | 37 | | |||
37 | KrAddBookmarkDlg::KrAddBookmarkDlg(QWidget *parent, QUrl url): | 38 | KrAddBookmarkDlg::KrAddBookmarkDlg(QWidget *parent, QUrl url): | ||
38 | QDialog(parent) | 39 | QDialog(parent) | ||
39 | { | 40 | { | ||
40 | setWindowModality(Qt::WindowModal); | 41 | setWindowModality(Qt::WindowModal); | ||
41 | setWindowTitle(i18n("Add Bookmark")); | 42 | setWindowTitle(i18n("Add Bookmark")); | ||
42 | 43 | | |||
43 | QVBoxLayout *mainLayout = new QVBoxLayout; | 44 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||
Show All 17 Lines | |||||
61 | // create in linedit and button | 62 | // create in linedit and button | ||
62 | QLabel *lb3 = new QLabel(i18n("Create in:"), this); | 63 | QLabel *lb3 = new QLabel(i18n("Create in:"), this); | ||
63 | _folder = new KLineEdit(this); | 64 | _folder = new KLineEdit(this); | ||
64 | layout->addWidget(lb3, 2, 0); | 65 | layout->addWidget(lb3, 2, 0); | ||
65 | layout->addWidget(_folder, 2, 1); | 66 | layout->addWidget(_folder, 2, 1); | ||
66 | _folder->setReadOnly(true); | 67 | _folder->setReadOnly(true); | ||
67 | 68 | | |||
68 | _createInBtn = new QToolButton(this); | 69 | _createInBtn = new QToolButton(this); | ||
69 | _createInBtn->setIcon(krLoader->loadIcon("go-down", KIconLoader::Small)); | 70 | _createInBtn->setIcon(Icon("go-down")); | ||
70 | _createInBtn->setCheckable(true); | 71 | _createInBtn->setCheckable(true); | ||
71 | connect(_createInBtn, SIGNAL(toggled(bool)), this, SLOT(toggleCreateIn(bool))); | 72 | connect(_createInBtn, SIGNAL(toggled(bool)), this, SLOT(toggleCreateIn(bool))); | ||
72 | layout->addWidget(_createInBtn, 2, 2); | 73 | layout->addWidget(_createInBtn, 2, 2); | ||
73 | 74 | | |||
74 | mainLayout->addLayout(layout); | 75 | mainLayout->addLayout(layout); | ||
75 | 76 | | |||
76 | detailsWidget = createInWidget(); | 77 | detailsWidget = createInWidget(); | ||
77 | detailsWidget->setVisible(false); | 78 | detailsWidget->setVisible(false); | ||
Show All 14 Lines | |||||
92 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); | 93 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); | ||
93 | 94 | | |||
94 | _name->setFocus(); | 95 | _name->setFocus(); | ||
95 | resize(sizeHint().width() * 2, sizeHint().height()); | 96 | resize(sizeHint().width() * 2, sizeHint().height()); | ||
96 | } | 97 | } | ||
97 | 98 | | |||
98 | void KrAddBookmarkDlg::toggleCreateIn(bool show) | 99 | void KrAddBookmarkDlg::toggleCreateIn(bool show) | ||
99 | { | 100 | { | ||
100 | _createInBtn->setIcon(krLoader->loadIcon(show ? "go-up" : "go-down", KIconLoader::Small)); | 101 | _createInBtn->setIcon(Icon(show ? "go-up" : "go-down")); | ||
101 | newFolderButton->setVisible(show); | 102 | newFolderButton->setVisible(show); | ||
102 | detailsWidget->setVisible(show); | 103 | detailsWidget->setVisible(show); | ||
103 | } | 104 | } | ||
104 | 105 | | |||
105 | // creates the widget that lets you decide where to put the new bookmark | 106 | // creates the widget that lets you decide where to put the new bookmark | ||
106 | QWidget *KrAddBookmarkDlg::createInWidget() | 107 | QWidget *KrAddBookmarkDlg::createInWidget() | ||
107 | { | 108 | { | ||
108 | _createIn = new KrTreeWidget(this); | 109 | _createIn = new KrTreeWidget(this); | ||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |