Changeset View
Changeset View
Standalone View
Standalone View
krusader/DiskUsage/diskusagegui.cpp
Show All 26 Lines | |||||
27 | // QtWidgets | 27 | // QtWidgets | ||
28 | #include <QDialogButtonBox> | 28 | #include <QDialogButtonBox> | ||
29 | #include <QGridLayout> | 29 | #include <QGridLayout> | ||
30 | #include <QHBoxLayout> | 30 | #include <QHBoxLayout> | ||
31 | #include <QLabel> | 31 | #include <QLabel> | ||
32 | 32 | | |||
33 | #include <KConfigCore/KSharedConfig> | 33 | #include <KConfigCore/KSharedConfig> | ||
34 | #include <KI18n/KLocalizedString> | 34 | #include <KI18n/KLocalizedString> | ||
35 | #include <KIconThemes/KIconLoader> | | |||
36 | 35 | | |||
37 | #include "../kicons.h" | | |||
38 | #include "../krglobal.h" | 36 | #include "../krglobal.h" | ||
37 | #include "../icon.h" | ||||
39 | #include "../FileSystem/filesystem.h" | 38 | #include "../FileSystem/filesystem.h" | ||
40 | #include "../Dialogs/krdialogs.h" | 39 | #include "../Dialogs/krdialogs.h" | ||
41 | 40 | | |||
42 | DiskUsageGUI::DiskUsageGUI(const QUrl &openDir) | 41 | DiskUsageGUI::DiskUsageGUI(const QUrl &openDir) | ||
43 | : QDialog(nullptr), exitAtFailure(true) | 42 | : QDialog(nullptr), exitAtFailure(true) | ||
44 | { | 43 | { | ||
45 | setWindowTitle(i18n("Krusader::Disk Usage")); | 44 | setWindowTitle(i18n("Krusader::Disk Usage")); | ||
46 | setAttribute(Qt::WA_DeleteOnClose); | 45 | setAttribute(Qt::WA_DeleteOnClose); | ||
47 | 46 | | |||
48 | baseDirectory = openDir; | 47 | baseDirectory = openDir; | ||
49 | 48 | | |||
50 | QVBoxLayout *mainLayout = new QVBoxLayout; | 49 | QVBoxLayout *mainLayout = new QVBoxLayout; | ||
51 | setLayout(mainLayout); | 50 | setLayout(mainLayout); | ||
52 | 51 | | |||
53 | QGridLayout *duGrid = new QGridLayout(); | 52 | QGridLayout *duGrid = new QGridLayout(); | ||
54 | duGrid->setSpacing(6); | 53 | duGrid->setSpacing(6); | ||
55 | duGrid->setContentsMargins(11, 11, 11, 11); | 54 | duGrid->setContentsMargins(11, 11, 11, 11); | ||
56 | 55 | | |||
57 | QWidget *duTools = new QWidget(this); | 56 | QWidget *duTools = new QWidget(this); | ||
58 | QHBoxLayout *duHBox = new QHBoxLayout(duTools); | 57 | QHBoxLayout *duHBox = new QHBoxLayout(duTools); | ||
59 | duHBox->setContentsMargins(0, 0, 0, 0); | 58 | duHBox->setContentsMargins(0, 0, 0, 0); | ||
60 | duTools->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 59 | duTools->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
61 | 60 | | |||
62 | btnNewSearch = new QToolButton(duTools); | 61 | btnNewSearch = new QToolButton(duTools); | ||
63 | btnNewSearch->setIcon(QIcon(krLoader->loadIcon("document-open", KIconLoader::Desktop))); | 62 | btnNewSearch->setIcon(Icon("document-open")); | ||
64 | duHBox->addWidget(btnNewSearch); | 63 | duHBox->addWidget(btnNewSearch); | ||
65 | btnNewSearch->setToolTip(i18n("Start new disk usage search")); | 64 | btnNewSearch->setToolTip(i18n("Start new disk usage search")); | ||
66 | 65 | | |||
67 | btnRefresh = new QToolButton(duTools); | 66 | btnRefresh = new QToolButton(duTools); | ||
68 | btnRefresh->setIcon(QIcon(krLoader->loadIcon("view-refresh", KIconLoader::Desktop))); | 67 | btnRefresh->setIcon(Icon("view-refresh")); | ||
69 | duHBox->addWidget(btnRefresh); | 68 | duHBox->addWidget(btnRefresh); | ||
70 | btnRefresh->setToolTip(i18n("Refresh")); | 69 | btnRefresh->setToolTip(i18n("Refresh")); | ||
71 | 70 | | |||
72 | btnDirUp = new QToolButton(duTools); | 71 | btnDirUp = new QToolButton(duTools); | ||
73 | btnDirUp->setIcon(QIcon(krLoader->loadIcon("go-up", KIconLoader::Desktop))); | 72 | btnDirUp->setIcon(Icon("go-up")); | ||
74 | duHBox->addWidget(btnDirUp); | 73 | duHBox->addWidget(btnDirUp); | ||
75 | btnDirUp->setToolTip(i18n("Parent folder")); | 74 | btnDirUp->setToolTip(i18n("Parent folder")); | ||
76 | 75 | | |||
77 | QWidget *separatorWidget = new QWidget(duTools); | 76 | QWidget *separatorWidget = new QWidget(duTools); | ||
78 | separatorWidget->setMinimumWidth(10); | 77 | separatorWidget->setMinimumWidth(10); | ||
79 | duHBox->addWidget(separatorWidget); | 78 | duHBox->addWidget(separatorWidget); | ||
80 | 79 | | |||
81 | btnLines = new QToolButton(duTools); | 80 | btnLines = new QToolButton(duTools); | ||
82 | btnLines->setIcon(QIcon(krLoader->loadIcon("view-list-details", KIconLoader::Desktop))); | 81 | btnLines->setIcon(Icon("view-list-details")); | ||
83 | btnLines->setCheckable(true); | 82 | btnLines->setCheckable(true); | ||
84 | duHBox->addWidget(btnLines); | 83 | duHBox->addWidget(btnLines); | ||
85 | btnLines->setToolTip(i18n("Line view")); | 84 | btnLines->setToolTip(i18n("Line view")); | ||
86 | 85 | | |||
87 | btnDetailed = new QToolButton(duTools); | 86 | btnDetailed = new QToolButton(duTools); | ||
88 | btnDetailed->setIcon(QIcon(krLoader->loadIcon("view-list-tree", KIconLoader::Desktop))); | 87 | btnDetailed->setIcon(Icon("view-list-tree")); | ||
89 | btnDetailed->setCheckable(true); | 88 | btnDetailed->setCheckable(true); | ||
90 | duHBox->addWidget(btnDetailed); | 89 | duHBox->addWidget(btnDetailed); | ||
91 | btnDetailed->setToolTip(i18n("Detailed view")); | 90 | btnDetailed->setToolTip(i18n("Detailed view")); | ||
92 | 91 | | |||
93 | btnFilelight = new QToolButton(duTools); | 92 | btnFilelight = new QToolButton(duTools); | ||
94 | btnFilelight->setIcon(QIcon(krLoader->loadIcon("kr_diskusage", KIconLoader::Desktop))); | 93 | btnFilelight->setIcon(Icon("kr_diskusage")); | ||
95 | btnFilelight->setCheckable(true); | 94 | btnFilelight->setCheckable(true); | ||
96 | duHBox->addWidget(btnFilelight); | 95 | duHBox->addWidget(btnFilelight); | ||
97 | btnFilelight->setToolTip(i18n("Filelight view")); | 96 | btnFilelight->setToolTip(i18n("Filelight view")); | ||
98 | 97 | | |||
99 | QWidget *spacerWidget = new QWidget(duTools); | 98 | QWidget *spacerWidget = new QWidget(duTools); | ||
100 | duHBox->addWidget(spacerWidget); | 99 | duHBox->addWidget(spacerWidget); | ||
101 | QHBoxLayout *hboxlayout = new QHBoxLayout(spacerWidget); | 100 | QHBoxLayout *hboxlayout = new QHBoxLayout(spacerWidget); | ||
102 | QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed); | 101 | QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Fixed); | ||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |