Changeset View
Changeset View
Standalone View
Standalone View
Modules/samba/main.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 34 | { | |||
---|---|---|---|---|---|
44 | about->addAuthor(i18n("Alexander Neundorf"), QString(), QStringLiteral("neundorf@kde.org")); | 44 | about->addAuthor(i18n("Alexander Neundorf"), QString(), QStringLiteral("neundorf@kde.org")); | ||
45 | about->addAuthor(i18n("Harald Sitter"), QString(), QStringLiteral("sitter@kde.org")); | 45 | about->addAuthor(i18n("Harald Sitter"), QString(), QStringLiteral("sitter@kde.org")); | ||
46 | setAboutData(about); | 46 | setAboutData(about); | ||
47 | 47 | | |||
48 | QVBoxLayout *layout = new QVBoxLayout(this); | 48 | QVBoxLayout *layout = new QVBoxLayout(this); | ||
49 | Q_ASSERT(this->layout()); | 49 | Q_ASSERT(this->layout()); | ||
50 | setLayout(layout); | 50 | setLayout(layout); | ||
51 | 51 | | |||
52 | addTableView(i18n("&Exports"), new KSambaShareModel(this)); | 52 | addTableView(i18nc("@title/group", "Exported Shares"), new KSambaShareModel(this)); | ||
53 | 53 | | |||
54 | auto importsView = addTableView(i18n("&Imports"), new SmbMountModel(this)); | 54 | auto importsView = addTableView(i18nc("@title/group", "Mounted Shares"), new SmbMountModel(this)); | ||
55 | importsView->horizontalHeader()->setSectionResizeMode(static_cast<int>(SmbMountModel::ColumnRole::Accessible), | 55 | importsView->horizontalHeader()->setSectionResizeMode(static_cast<int>(SmbMountModel::ColumnRole::Accessible), | ||
56 | QHeaderView::ResizeToContents); | 56 | QHeaderView::ResizeToContents); | ||
57 | 57 | | |||
58 | setButtons(Help); | 58 | setButtons(Help); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | QTableView *SambaContainer::addTableView(const QString &localizedLabel, QAbstractListModel *model) | 61 | QTableView *SambaContainer::addTableView(const QString &localizedLabel, QAbstractListModel *model) | ||
62 | { | 62 | { | ||
63 | QString text = localizedLabel; | | |||
64 | auto title = new KTitleWidget(this); | 63 | auto title = new KTitleWidget(this); | ||
65 | // hackily remove ampersand to not break i18n too much in 5.18 | 64 | title->setText(localizedLabel); | ||
66 | // TODO: replace i18n'd string to one without quick access marker | | |||
67 | title->setText(text.remove("&")); | | |||
68 | title->setLevel(2); | 65 | title->setLevel(2); | ||
69 | layout()->addWidget(title); | 66 | layout()->addWidget(title); | ||
70 | 67 | | |||
71 | auto view = new QTableView(this); | 68 | auto view = new QTableView(this); | ||
72 | layout()->addWidget(view); | 69 | layout()->addWidget(view); | ||
73 | view->setModel(model); | 70 | view->setModel(model); | ||
74 | view->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); | 71 | view->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); | ||
75 | view->horizontalHeader()->reset(); | 72 | view->horizontalHeader()->reset(); | ||
76 | view->horizontalHeader()->setVisible(true); | 73 | view->horizontalHeader()->setVisible(true); | ||
77 | view->verticalHeader()->setVisible(false); | 74 | view->verticalHeader()->setVisible(false); | ||
78 | 75 | | |||
79 | return view; | 76 | return view; | ||
80 | } | 77 | } | ||
81 | 78 | | |||
82 | #include "main.moc" | 79 | #include "main.moc" |