Changeset View
Changeset View
Standalone View
Standalone View
krusader/BookMan/kraddbookmarkdlg.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 40 | { | |||
---|---|---|---|---|---|
64 | _folder = new KLineEdit(this); | 64 | _folder = new KLineEdit(this); | ||
65 | layout->addWidget(lb3, 2, 0); | 65 | layout->addWidget(lb3, 2, 0); | ||
66 | layout->addWidget(_folder, 2, 1); | 66 | layout->addWidget(_folder, 2, 1); | ||
67 | _folder->setReadOnly(true); | 67 | _folder->setReadOnly(true); | ||
68 | 68 | | |||
69 | _createInBtn = new QToolButton(this); | 69 | _createInBtn = new QToolButton(this); | ||
70 | _createInBtn->setIcon(Icon("go-down")); | 70 | _createInBtn->setIcon(Icon("go-down")); | ||
71 | _createInBtn->setCheckable(true); | 71 | _createInBtn->setCheckable(true); | ||
72 | connect(_createInBtn, SIGNAL(toggled(bool)), this, SLOT(toggleCreateIn(bool))); | 72 | connect(_createInBtn, &QToolButton::toggled, this, &KrAddBookmarkDlg::toggleCreateIn); | ||
73 | layout->addWidget(_createInBtn, 2, 2); | 73 | layout->addWidget(_createInBtn, 2, 2); | ||
74 | 74 | | |||
75 | mainLayout->addLayout(layout); | 75 | mainLayout->addLayout(layout); | ||
76 | 76 | | |||
77 | detailsWidget = createInWidget(); | 77 | detailsWidget = createInWidget(); | ||
78 | detailsWidget->setVisible(false); | 78 | detailsWidget->setVisible(false); | ||
79 | mainLayout->addWidget(detailsWidget); | 79 | mainLayout->addWidget(detailsWidget); | ||
80 | 80 | | |||
81 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | 81 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel); | ||
82 | mainLayout->addWidget(buttonBox); | 82 | mainLayout->addWidget(buttonBox); | ||
83 | 83 | | |||
84 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | 84 | QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok); | ||
85 | okButton->setDefault(true); | 85 | okButton->setDefault(true); | ||
86 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | 86 | okButton->setShortcut(Qt::CTRL | Qt::Key_Return); | ||
87 | newFolderButton = new QPushButton(i18n("New Folder")); | 87 | newFolderButton = new QPushButton(i18n("New Folder")); | ||
88 | buttonBox->addButton(newFolderButton, QDialogButtonBox::ActionRole); | 88 | buttonBox->addButton(newFolderButton, QDialogButtonBox::ActionRole); | ||
89 | newFolderButton->setVisible(false);// hide it until _createIn is shown | 89 | newFolderButton->setVisible(false);// hide it until _createIn is shown | ||
90 | connect(newFolderButton, SIGNAL(clicked()), this, SLOT(newFolder())); | 90 | connect(newFolderButton, &QPushButton::clicked, this, &KrAddBookmarkDlg::newFolder); | ||
91 | 91 | | |||
92 | connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); | 92 | connect(buttonBox, &QDialogButtonBox::accepted, this, &KrAddBookmarkDlg::accept); | ||
93 | connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); | 93 | connect(buttonBox, &QDialogButtonBox::rejected, this, &KrAddBookmarkDlg::reject); | ||
94 | 94 | | |||
95 | _name->setFocus(); | 95 | _name->setFocus(); | ||
96 | resize(sizeHint().width() * 2, sizeHint().height()); | 96 | resize(sizeHint().width() * 2, sizeHint().height()); | ||
97 | } | 97 | } | ||
98 | 98 | | |||
99 | void KrAddBookmarkDlg::toggleCreateIn(bool show) | 99 | void KrAddBookmarkDlg::toggleCreateIn(bool show) | ||
100 | { | 100 | { | ||
101 | _createInBtn->setIcon(Icon(show ? "go-up" : "go-down")); | 101 | _createInBtn->setIcon(Icon(show ? "go-up" : "go-down")); | ||
Show All 14 Lines | 108 | { | |||
116 | item->setText(0, i18n("Bookmarks")); | 116 | item->setText(0, i18n("Bookmarks")); | ||
117 | _createIn->expandItem(item); | 117 | _createIn->expandItem(item); | ||
118 | item->setSelected(true); | 118 | item->setSelected(true); | ||
119 | _xr[item] = krBookMan->_root; | 119 | _xr[item] = krBookMan->_root; | ||
120 | 120 | | |||
121 | populateCreateInWidget(krBookMan->_root, item); | 121 | populateCreateInWidget(krBookMan->_root, item); | ||
122 | _createIn->setCurrentItem(item); | 122 | _createIn->setCurrentItem(item); | ||
123 | slotSelectionChanged(); | 123 | slotSelectionChanged(); | ||
124 | connect(_createIn, SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); | 124 | connect(_createIn, &KrTreeWidget::itemSelectionChanged, this, &KrAddBookmarkDlg::slotSelectionChanged); | ||
125 | 125 | | |||
126 | return _createIn; | 126 | return _createIn; | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | void KrAddBookmarkDlg::slotSelectionChanged() | 129 | void KrAddBookmarkDlg::slotSelectionChanged() | ||
130 | { | 130 | { | ||
131 | QList<QTreeWidgetItem *> items = _createIn->selectedItems(); | 131 | QList<QTreeWidgetItem *> items = _createIn->selectedItems(); | ||
132 | 132 | | |||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |