Changeset View
Changeset View
Standalone View
Standalone View
src/main/KexiMainWindow_p.cpp
Show All 16 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #include "KexiMainWindow_p.h" | 21 | #include "KexiMainWindow_p.h" | ||
22 | 22 | | |||
23 | #include <QPainter> | 23 | #include <QPainter> | ||
24 | #include <QDebug> | 24 | #include <QDebug> | ||
25 | #include <QDesktopServices> | ||||
25 | 26 | | |||
26 | #include <KDbUtils> | 27 | #include <KDbUtils> | ||
27 | 28 | | |||
28 | #include <kexiutils/SmallToolButton.h> | 29 | #include <kexiutils/SmallToolButton.h> | ||
29 | #include <kexiutils/KexiTester.h> | 30 | #include <kexiutils/KexiTester.h> | ||
30 | #include <kexiutils/KexiFadeWidgetEffect.h> | 31 | #include <kexiutils/KexiFadeWidgetEffect.h> | ||
31 | #include <KexiIcon.h> | 32 | #include <KexiIcon.h> | ||
32 | #include <core/kexipartmanager.h> | 33 | #include <core/kexipartmanager.h> | ||
▲ Show 20 Lines • Show All 199 Lines • ▼ Show 20 Line(s) | |||||
232 | } | 233 | } | ||
233 | 234 | | |||
234 | void KexiMainMenu::showEvent(QShowEvent * event) | 235 | void KexiMainMenu::showEvent(QShowEvent * event) | ||
235 | { | 236 | { | ||
236 | if (!m_initialized) { | 237 | if (!m_initialized) { | ||
237 | m_initialized = true; | 238 | m_initialized = true; | ||
238 | KActionCollection *ac = KexiMainWindowIface::global()->actionCollection(); | 239 | KActionCollection *ac = KexiMainWindowIface::global()->actionCollection(); | ||
239 | QHBoxLayout *hlyr = new QHBoxLayout(this); | 240 | QHBoxLayout *hlyr = new QHBoxLayout(this); | ||
241 | QVBoxLayout *vlyr = new QVBoxLayout(this); | ||||
242 | | ||||
240 | hlyr->setSpacing(0); | 243 | hlyr->setSpacing(0); | ||
241 | hlyr->setMargin(0); | 244 | hlyr->setMargin(0); | ||
245 | | ||||
246 | vlyr->setSpacing(0); | ||||
247 | vlyr->setMargin(0); | ||||
248 | | ||||
242 | m_menuWidget = new KexiMenuWidget; | 249 | m_menuWidget = new KexiMenuWidget; | ||
243 | //! @todo KEXI3 is KexiMenuWidgetStyle needed? | 250 | //! @todo KEXI3 is KexiMenuWidgetStyle needed? | ||
244 | #if 0 | 251 | #if 0 | ||
245 | QString styleName(m_menuWidget->style()->objectName()); | 252 | QString styleName(m_menuWidget->style()->objectName()); | ||
246 | if (KDE::version() < KDE_MAKE_VERSION(4, 8, 0) // a fix is apparently needed for glitch in KDE < 4.8 | 253 | if (KDE::version() < KDE_MAKE_VERSION(4, 8, 0) // a fix is apparently needed for glitch in KDE < 4.8 | ||
247 | && styleName == "oxygen") | 254 | && styleName == "oxygen") | ||
248 | { | 255 | { | ||
249 | KexiMenuWidgetStyle *customStyle = new KexiMenuWidgetStyle(m_menuWidget->style()->objectName(), this); | 256 | KexiMenuWidgetStyle *customStyle = new KexiMenuWidgetStyle(m_menuWidget->style()->objectName(), this); | ||
Show All 14 Lines | 259 | #endif | |||
264 | m_menuWidget->addAction(ac->action("project_import_export_send")); | 271 | m_menuWidget->addAction(ac->action("project_import_export_send")); | ||
265 | #ifdef KEXI_SHOW_UNIMPLEMENTED | 272 | #ifdef KEXI_SHOW_UNIMPLEMENTED | ||
266 | m_menuWidget->addAction(ac->action("project_properties")); | 273 | m_menuWidget->addAction(ac->action("project_properties")); | ||
267 | //! @todo project information | 274 | //! @todo project information | ||
268 | m_menuWidget->addAction(ac->action("settings")); | 275 | m_menuWidget->addAction(ac->action("settings")); | ||
269 | #endif | 276 | #endif | ||
270 | m_menuWidget->addSeparator(); | 277 | m_menuWidget->addSeparator(); | ||
271 | m_menuWidget->addAction(ac->action("quit")); | 278 | m_menuWidget->addAction(ac->action("quit")); | ||
272 | hlyr->addWidget(m_menuWidget); | 279 | vlyr->addWidget(m_menuWidget, 1); | ||
280 | | ||||
281 | //social media section | ||||
282 | QHBoxLayout *socialLayout = new QHBoxLayout(this); | ||||
staniek: > QLayout: Attempting to add QLayout "" to KexiMainMenu "", which already has a layout
But I… | |||||
283 | socialLayout->setMargin(2); | ||||
284 | QLabel *followUs = new QLabel(xi18n("Follow us on "), this); | ||||
285 | | ||||
staniek: please fix double empty lines | |||||
286 | socialLayout->addWidget(followUs); | ||||
287 | socialLayout->addStretch(); | ||||
288 | | ||||
289 | QPushButton *fbButton = new QPushButton(this); | ||||
290 | fbButton->setIcon(KexiIcon("im-facebook")); | ||||
291 | fbButton->setFlat(true); | ||||
292 | connect(fbButton, &QPushButton::clicked, [](){ | ||||
293 | QDesktopServices::openUrl(QUrl("https://www.facebook.com/kexi.project")); | ||||
294 | }); | ||||
295 | | ||||
296 | QPushButton *twButton = new QPushButton(this); | ||||
297 | twButton->setIcon(KexiIcon("im-twitter")); | ||||
298 | twButton->setFlat(true); | ||||
299 | connect(twButton, &QPushButton::clicked, [](){ | ||||
300 | QDesktopServices::openUrl(QUrl("https://twitter.com/kexi_project")); | ||||
301 | }); | ||||
302 | | ||||
303 | socialLayout->addWidget(fbButton); | ||||
304 | socialLayout->addWidget(twButton); | ||||
305 | | ||||
306 | vlyr->addLayout(socialLayout); | ||||
307 | | ||||
308 | hlyr->addLayout(vlyr); | ||||
staniek: please fix double empty lines | |||||
273 | m_content = new EmptyMenuContentWidget; | 309 | m_content = new EmptyMenuContentWidget; | ||
274 | m_content->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); | 310 | m_content->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); | ||
275 | m_content->installEventFilter(this); | 311 | m_content->installEventFilter(this); | ||
276 | m_mainContentLayout = new QVBoxLayout; | 312 | m_mainContentLayout = new QVBoxLayout; | ||
277 | hlyr->addLayout(m_mainContentLayout); | 313 | hlyr->addLayout(m_mainContentLayout); | ||
278 | m_contentLayout = new QStackedLayout(m_content); | 314 | m_contentLayout = new QStackedLayout(m_content); | ||
279 | m_contentLayout->setStackingMode(QStackedLayout::StackAll); | 315 | m_contentLayout->setStackingMode(QStackedLayout::StackAll); | ||
280 | m_contentLayout->setContentsMargins(0, 0, 0, 0); | 316 | m_contentLayout->setContentsMargins(0, 0, 0, 0); | ||
▲ Show 20 Lines • Show All 1308 Lines • Show Last 20 Lines |
But I am doing the same error in line 241 so please land and I would fix the layout myself.