Changeset View
Changeset View
Standalone View
Standalone View
krusader/MountMan/kmountmangui.cpp
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
69 | { | 69 | { | ||
70 | setWindowTitle(i18n("MountMan - Your Mount-Manager")); | 70 | setWindowTitle(i18n("MountMan - Your Mount-Manager")); | ||
71 | setWindowModality(Qt::WindowModal); | 71 | setWindowModality(Qt::WindowModal); | ||
72 | 72 | | |||
73 | QVBoxLayout *mainLayout = new QVBoxLayout; | 73 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||
74 | setLayout(mainLayout); | 74 | setLayout(mainLayout); | ||
75 | 75 | | |||
76 | watcher = new QTimer(this); | 76 | watcher = new QTimer(this); | ||
77 | connect(watcher, SIGNAL(timeout()), this, SLOT(checkMountChange())); | 77 | connect(watcher, &QTimer::timeout, this, &KMountManGUI::checkMountChange); | ||
78 | 78 | | |||
79 | mainLayout->addLayout(createMainPage()); | 79 | mainLayout->addLayout(createMainPage()); | ||
80 | 80 | | |||
81 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); | 81 | QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); | ||
82 | mainLayout->addWidget(buttonBox); | 82 | mainLayout->addWidget(buttonBox); | ||
83 | 83 | | |||
84 | ejectButton = new QPushButton(i18n("&Eject")); | 84 | ejectButton = new QPushButton(i18n("&Eject")); | ||
85 | ejectButton->setIcon(Icon(QStringLiteral("media-eject"))); | 85 | ejectButton->setIcon(Icon(QStringLiteral("media-eject"))); | ||
86 | ejectButton->setEnabled(false); | 86 | ejectButton->setEnabled(false); | ||
87 | buttonBox->addButton(ejectButton, QDialogButtonBox::ActionRole); | 87 | buttonBox->addButton(ejectButton, QDialogButtonBox::ActionRole); | ||
88 | 88 | | |||
89 | mountButton = new QPushButton(i18n("&Unmount")); | 89 | mountButton = new QPushButton(i18n("&Unmount")); | ||
90 | mountButton->setEnabled(false); | 90 | mountButton->setEnabled(false); | ||
91 | buttonBox->addButton(mountButton, QDialogButtonBox::ActionRole); | 91 | buttonBox->addButton(mountButton, QDialogButtonBox::ActionRole); | ||
92 | 92 | | |||
93 | // connections | 93 | // connections | ||
94 | connect(buttonBox, SIGNAL(rejected()), SLOT(reject())); | 94 | connect(buttonBox, &QDialogButtonBox::rejected, this, &KMountManGUI::reject); | ||
95 | connect(ejectButton, SIGNAL(clicked()), SLOT(slotEject())); | 95 | connect(ejectButton, &QPushButton::clicked, this, &KMountManGUI::slotEject); | ||
96 | connect(mountButton, SIGNAL(clicked()), SLOT(slotToggleMount())); | 96 | connect(mountButton, &QPushButton::clicked, this, &KMountManGUI::slotToggleMount); | ||
97 | connect(mountList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, | 97 | connect(mountList, &KrTreeWidget::itemDoubleClicked, this, &KMountManGUI::doubleClicked); | ||
98 | SLOT(doubleClicked(QTreeWidgetItem*))); | 98 | connect(mountList, &KrTreeWidget::itemRightClicked, this, &KMountManGUI::clicked); | ||
99 | connect(mountList, SIGNAL(itemRightClicked(QTreeWidgetItem*,QPoint,int)), | 99 | connect(mountList, &KrTreeWidget::itemClicked, this, QOverload<QTreeWidgetItem *>::of(&KMountManGUI::changeActive)); | ||
100 | this, SLOT(clicked(QTreeWidgetItem*,QPoint))); | 100 | connect(mountList, &KrTreeWidget::itemSelectionChanged, this, QOverload<>::of(&KMountManGUI::changeActive)); | ||
101 | connect(mountList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, | | |||
102 | SLOT(changeActive(QTreeWidgetItem*))); | | |||
103 | connect(mountList, SIGNAL(itemSelectionChanged()), this, | | |||
104 | SLOT(changeActive())); | | |||
105 | 101 | | |||
106 | KConfigGroup group(krConfig, "MountMan"); | 102 | KConfigGroup group(krConfig, "MountMan"); | ||
107 | int sx = group.readEntry("Window Width", -1); | 103 | int sx = group.readEntry("Window Width", -1); | ||
108 | int sy = group.readEntry("Window Height", -1); | 104 | int sy = group.readEntry("Window Height", -1); | ||
109 | 105 | | |||
110 | if (sx != -1 && sy != -1) | 106 | if (sx != -1 && sy != -1) | ||
111 | resize(sx, sy); | 107 | resize(sx, sy); | ||
112 | else | 108 | else | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 147 | { | |||
197 | box->setAlignment(Qt::AlignHCenter); | 193 | box->setAlignment(Qt::AlignHCenter); | ||
198 | QVBoxLayout *vboxl = new QVBoxLayout(box); | 194 | QVBoxLayout *vboxl = new QVBoxLayout(box); | ||
199 | info = new KRFSDisplay(box); | 195 | info = new KRFSDisplay(box); | ||
200 | vboxl->addWidget(info); | 196 | vboxl->addWidget(info); | ||
201 | info->resize(info->width(), height()); | 197 | info->resize(info->width(), height()); | ||
202 | 198 | | |||
203 | cbShowOnlyRemovable = new QCheckBox(i18n("Show only removable devices"), this); | 199 | cbShowOnlyRemovable = new QCheckBox(i18n("Show only removable devices"), this); | ||
204 | cbShowOnlyRemovable->setChecked(grp.readEntry("ShowOnlyRemovable", false)); | 200 | cbShowOnlyRemovable->setChecked(grp.readEntry("ShowOnlyRemovable", false)); | ||
205 | connect(cbShowOnlyRemovable , SIGNAL(stateChanged(int)), SLOT(updateList())); | 201 | connect(cbShowOnlyRemovable , &QCheckBox::stateChanged, this, &KMountManGUI::updateList); | ||
206 | 202 | | |||
207 | layout->addWidget(box, 0, 0); | 203 | layout->addWidget(box, 0, 0); | ||
208 | layout->addWidget(cbShowOnlyRemovable, 1, 0); | 204 | layout->addWidget(cbShowOnlyRemovable, 1, 0); | ||
209 | layout->addWidget(mountList, 0, 1, 2, 1); | 205 | layout->addWidget(mountList, 0, 1, 2, 1); | ||
210 | 206 | | |||
211 | return layout; | 207 | return layout; | ||
212 | } | 208 | } | ||
213 | 209 | | |||
▲ Show 20 Lines • Show All 317 Lines • Show Last 20 Lines |