Changeset View
Changeset View
Standalone View
Standalone View
korgac/alarmdialog.cpp
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | 139 | { | |||
---|---|---|---|---|---|
176 | setWindowTitle(i18nc("@title:window", "Reminders")); | 176 | setWindowTitle(i18nc("@title:window", "Reminders")); | ||
177 | setWindowIcon(QIcon::fromTheme(QStringLiteral("korgac"))); | 177 | setWindowIcon(QIcon::fromTheme(QStringLiteral("korgac"))); | ||
178 | QDialogButtonBox *buttonBox = new QDialogButtonBox(this); | 178 | QDialogButtonBox *buttonBox = new QDialogButtonBox(this); | ||
179 | QVBoxLayout *mainLayout = new QVBoxLayout(this); | 179 | QVBoxLayout *mainLayout = new QVBoxLayout(this); | ||
180 | mainLayout->addWidget(topBox); | 180 | mainLayout->addWidget(topBox); | ||
181 | mOkButton = new QToolButton; | 181 | mOkButton = new QToolButton; | ||
182 | mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return); | 182 | mOkButton->setShortcut(Qt::CTRL | Qt::Key_Return); | ||
183 | mUser1Button = new QPushButton; | 183 | mUser1Button = new QPushButton; | ||
184 | mUser1Button->setDefault(false); | ||||
184 | buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole); | 185 | buttonBox->addButton(mUser1Button, QDialogButtonBox::ActionRole); | ||
185 | mUser2Button = new QPushButton; | 186 | mUser2Button = new QPushButton; | ||
187 | mUser2Button->setDefault(false); | ||||
186 | buttonBox->addButton(mUser2Button, QDialogButtonBox::ActionRole); | 188 | buttonBox->addButton(mUser2Button, QDialogButtonBox::ActionRole); | ||
187 | mUser3Button = new QPushButton; | 189 | mUser3Button = new QPushButton; | ||
190 | mUser3Button->setDefault(false); | ||||
188 | buttonBox->addButton(mUser3Button, QDialogButtonBox::ActionRole); | 191 | buttonBox->addButton(mUser3Button, QDialogButtonBox::ActionRole); | ||
189 | connect(buttonBox, &QDialogButtonBox::accepted, this, &AlarmDialog::accept); | 192 | connect(buttonBox, &QDialogButtonBox::accepted, this, &AlarmDialog::accept); | ||
190 | connect(buttonBox, &QDialogButtonBox::rejected, this, &AlarmDialog::reject); | 193 | connect(buttonBox, &QDialogButtonBox::rejected, this, &AlarmDialog::reject); | ||
191 | mainLayout->addWidget(buttonBox); | 194 | mainLayout->addWidget(buttonBox); | ||
192 | buttonBox->addButton(mOkButton, QDialogButtonBox::ActionRole); | 195 | buttonBox->addButton(mOkButton, QDialogButtonBox::ActionRole); | ||
193 | 196 | | |||
194 | mUser3Button->setText(i18nc("@action:button", "Dismiss Reminder")); | 197 | mUser3Button->setText(i18nc("@action:button", "Dismiss Reminder")); | ||
195 | mUser3Button->setToolTip(i18nc("@info:tooltip", | 198 | mUser3Button->setToolTip(i18nc("@info:tooltip", | ||
▲ Show 20 Lines • Show All 757 Lines • ▼ Show 20 Line(s) | 955 | if (count == 1) { | |||
953 | ReminderTreeItem *item = selection.first(); | 956 | ReminderTreeItem *item = selection.first(); | ||
954 | if (mCalendar) { | 957 | if (mCalendar) { | ||
955 | mUser1Button->setEnabled(mCalendar->hasRight(item->mIncidence, | 958 | mUser1Button->setEnabled(mCalendar->hasRight(item->mIncidence, | ||
956 | Akonadi::Collection::CanChangeItem)); | 959 | Akonadi::Collection::CanChangeItem)); | ||
957 | } | 960 | } | ||
958 | } else { | 961 | } else { | ||
959 | mUser1Button->setEnabled(false); | 962 | mUser1Button->setEnabled(false); | ||
960 | } | 963 | } | ||
964 | if (enabled) { | ||||
965 | mIncidenceTree->setFocus(); | ||||
966 | mIncidenceTree->setCurrentItem(selection.first()); | ||||
967 | } | ||||
961 | } | 968 | } | ||
962 | 969 | | |||
963 | void AlarmDialog::toggleDetails(QTreeWidgetItem *item) | 970 | void AlarmDialog::toggleDetails(QTreeWidgetItem *item) | ||
964 | { | 971 | { | ||
965 | if (!item) { | 972 | if (!item) { | ||
966 | return; | 973 | return; | ||
967 | } | 974 | } | ||
968 | 975 | | |||
▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines |