Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kfilewidget.cpp
Show First 20 Lines • Show All 356 Lines • ▼ Show 20 Line(s) | 347 | { | |||
---|---|---|---|---|---|
357 | // The dialog shows them | 357 | // The dialog shows them | ||
358 | d->okButton->hide(); | 358 | d->okButton->hide(); | ||
359 | d->cancelButton->hide(); | 359 | d->cancelButton->hide(); | ||
360 | 360 | | |||
361 | d->opsWidget = new QWidget(this); | 361 | d->opsWidget = new QWidget(this); | ||
362 | QVBoxLayout *opsWidgetLayout = new QVBoxLayout(d->opsWidget); | 362 | QVBoxLayout *opsWidgetLayout = new QVBoxLayout(d->opsWidget); | ||
363 | opsWidgetLayout->setMargin(0); | 363 | opsWidgetLayout->setMargin(0); | ||
364 | opsWidgetLayout->setSpacing(0); | 364 | opsWidgetLayout->setSpacing(0); | ||
365 | //d->toolbar = new KToolBar(this, true); | 365 | //d->toolbar = new KToolBar(this, true); | ||
366 | d->toolbar = new KToolBar(d->opsWidget, true); | 366 | d->toolbar = new KToolBar(d->opsWidget, true); | ||
rkflx: ? | |||||
Oops, somehow arc merged this patch with D12333 when I downloaded it. Not sure how I managed to do that. Cleaned up now. ngraham: Oops, somehow `arc` merged this patch with D12333 when I downloaded it. Not sure how I managed… | |||||
367 | d->toolbar->setObjectName(QStringLiteral("KFileWidget::toolbar")); | 367 | d->toolbar->setObjectName(QStringLiteral("KFileWidget::toolbar")); | ||
368 | d->toolbar->setMovable(false); | 368 | d->toolbar->setMovable(false); | ||
369 | opsWidgetLayout->addWidget(d->toolbar); | 369 | opsWidgetLayout->addWidget(d->toolbar); | ||
rkflx: ? | |||||
ngraham: Same, sorry. | |||||
370 | 370 | | |||
371 | d->model = new KFilePlacesModel(this); | 371 | d->model = new KFilePlacesModel(this); | ||
372 | 372 | | |||
373 | // Resolve this now so that a 'kfiledialog:' URL, if specified, | 373 | // Resolve this now so that a 'kfiledialog:' URL, if specified, | ||
374 | // does not get inserted into the urlNavigator history. | 374 | // does not get inserted into the urlNavigator history. | ||
375 | d->url = getStartUrl(startDir, d->fileClass, filename); | 375 | d->url = getStartUrl(startDir, d->fileClass, filename); | ||
376 | startDir = d->url; | 376 | startDir = d->url; | ||
377 | 377 | | |||
▲ Show 20 Lines • Show All 103 Lines • ▼ Show 20 Line(s) | 406 | #endif | |||
481 | menu->setWhatsThis(i18n("<qt>This is the preferences menu for the file dialog. " | 481 | menu->setWhatsThis(i18n("<qt>This is the preferences menu for the file dialog. " | ||
482 | "Various options can be accessed from this menu including: <ul>" | 482 | "Various options can be accessed from this menu including: <ul>" | ||
483 | "<li>how files are sorted in the list</li>" | 483 | "<li>how files are sorted in the list</li>" | ||
484 | "<li>types of view, including icon and list</li>" | 484 | "<li>types of view, including icon and list</li>" | ||
485 | "<li>showing of hidden files</li>" | 485 | "<li>showing of hidden files</li>" | ||
486 | "<li>the Places navigation panel</li>" | 486 | "<li>the Places navigation panel</li>" | ||
487 | "<li>file previews</li>" | 487 | "<li>file previews</li>" | ||
488 | "<li>separating folders from files</li></ul></qt>")); | 488 | "<li>separating folders from files</li></ul></qt>")); | ||
489 | menu->addAction(coll->action(QStringLiteral("sorting menu"))); | | |||
490 | menu->addAction(coll->action(QStringLiteral("view menu"))); | 489 | menu->addAction(coll->action(QStringLiteral("view menu"))); | ||
491 | menu->addSeparator(); | 490 | menu->addSeparator(); | ||
492 | menu->addAction(coll->action(QStringLiteral("decoration menu"))); | 491 | menu->addAction(coll->action(QStringLiteral("decoration menu"))); | ||
493 | menu->addSeparator(); | 492 | menu->addSeparator(); | ||
494 | menu->addAction(coll->action(QStringLiteral("show hidden"))); | 493 | menu->addAction(coll->action(QStringLiteral("show hidden"))); | ||
495 | menu->addAction(showSidebarAction); | 494 | menu->addAction(showSidebarAction); | ||
496 | menu->addAction(showBookmarksAction); | 495 | menu->addAction(showBookmarksAction); | ||
497 | coll->action(QStringLiteral("inline preview")); | 496 | coll->action(QStringLiteral("inline preview")); | ||
Show All 39 Lines | |||||
537 | d->toolbar->addAction(coll->action(QStringLiteral("forward"))); | 536 | d->toolbar->addAction(coll->action(QStringLiteral("forward"))); | ||
538 | d->toolbar->addAction(coll->action(QStringLiteral("up"))); | 537 | d->toolbar->addAction(coll->action(QStringLiteral("up"))); | ||
539 | d->toolbar->addAction(coll->action(QStringLiteral("reload"))); | 538 | d->toolbar->addAction(coll->action(QStringLiteral("reload"))); | ||
540 | d->toolbar->addAction(separator); | 539 | d->toolbar->addAction(separator); | ||
541 | d->toolbar->addAction(coll->action(QStringLiteral("short view"))); | 540 | d->toolbar->addAction(coll->action(QStringLiteral("short view"))); | ||
542 | d->toolbar->addAction(coll->action(QStringLiteral("detailed tree view"))); | 541 | d->toolbar->addAction(coll->action(QStringLiteral("detailed tree view"))); | ||
543 | d->toolbar->addAction(separator2); | 542 | d->toolbar->addAction(separator2); | ||
544 | d->toolbar->addAction(coll->action(QStringLiteral("inline preview"))); | 543 | d->toolbar->addAction(coll->action(QStringLiteral("inline preview"))); | ||
544 | d->toolbar->addAction(coll->action(QStringLiteral("sorting menu"))); | ||||
545 | d->toolbar->addWidget(midSpacer); | 545 | d->toolbar->addWidget(midSpacer); | ||
546 | d->toolbar->addAction(furtherAction); | 546 | d->toolbar->addAction(furtherAction); | ||
547 | d->toolbar->addWidget(d->iconSizeSlider); | 547 | d->toolbar->addWidget(d->iconSizeSlider); | ||
548 | d->toolbar->addAction(closerAction); | 548 | d->toolbar->addAction(closerAction); | ||
549 | d->toolbar->addAction(separator3); | 549 | d->toolbar->addAction(separator3); | ||
550 | d->toolbar->addAction(coll->action(QStringLiteral("mkdir"))); | 550 | d->toolbar->addAction(coll->action(QStringLiteral("mkdir"))); | ||
551 | d->toolbar->addAction(menu); | 551 | d->toolbar->addAction(menu); | ||
552 | 552 | | |||
553 | d->toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); | 553 | d->toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); | ||
554 | d->toolbar->setMovable(false); | 554 | d->toolbar->setMovable(false); | ||
555 | 555 | | |||
556 | KUrlCompletion *pathCompletionObj = new KUrlCompletion(KUrlCompletion::DirCompletion); | 556 | KUrlCompletion *pathCompletionObj = new KUrlCompletion(KUrlCompletion::DirCompletion); | ||
557 | pathCombo->setCompletionObject(pathCompletionObj); | 557 | pathCombo->setCompletionObject(pathCompletionObj); | ||
558 | pathCombo->setAutoDeleteCompletionObject(true); | 558 | pathCombo->setAutoDeleteCompletionObject(true); | ||
559 | 559 | | |||
560 | connect(d->urlNavigator, SIGNAL(urlChanged(QUrl)), | 560 | connect(d->urlNavigator, SIGNAL(urlChanged(QUrl)), | ||
561 | this, SLOT(_k_enterUrl(QUrl))); | 561 | this, SLOT(_k_enterUrl(QUrl))); | ||
This also worked for me, and would avoid the foreach: KActionMenu *x = new KActionMenu(QIcon::fromTheme(QStringLiteral("configure")), i18n("Options"), this); x->setMenu(coll->action(QStringLiteral("sorting menu"))->menu()); x->setDelayed(false); d->toolbar->addAction(x); rkflx: This also worked for me, and would avoid the `foreach`:
```
KActionMenu *x = new… | |||||
ngraham: Found an even simpler way. :) | |||||
562 | connect(d->urlNavigator, SIGNAL(returnPressed()), | 562 | connect(d->urlNavigator, SIGNAL(returnPressed()), | ||
563 | d->ops, SLOT(setFocus())); | 563 | d->ops, SLOT(setFocus())); | ||
rkflx: Unintentional newline? | |||||
564 | 564 | | |||
565 | QString whatsThisText; | 565 | QString whatsThisText; | ||
566 | 566 | | |||
567 | // the Location label/edit | 567 | // the Location label/edit | ||
568 | d->locationLabel = new QLabel(i18n("&Name:"), this); | 568 | d->locationLabel = new QLabel(i18n("&Name:"), this); | ||
569 | d->locationEdit = new KUrlComboBox(KUrlComboBox::Files, true, this); | 569 | d->locationEdit = new KUrlComboBox(KUrlComboBox::Files, true, this); | ||
570 | d->locationEdit->installEventFilter(this); | 570 | d->locationEdit->installEventFilter(this); | ||
571 | // Properly let the dialog be resized (to smaller). Otherwise we could have | 571 | // Properly let the dialog be resized (to smaller). Otherwise we could have | ||
▲ Show 20 Lines • Show All 824 Lines • ▼ Show 20 Line(s) | |||||
1396 | } | 1396 | } | ||
1397 | 1397 | | |||
1398 | void KFileWidgetPrivate::initGUI() | 1398 | void KFileWidgetPrivate::initGUI() | ||
1399 | { | 1399 | { | ||
1400 | delete boxLayout; // deletes all sub layouts | 1400 | delete boxLayout; // deletes all sub layouts | ||
1401 | 1401 | | |||
1402 | boxLayout = new QVBoxLayout(q); | 1402 | boxLayout = new QVBoxLayout(q); | ||
1403 | boxLayout->setMargin(0); // no additional margin to the already existing | 1403 | boxLayout->setMargin(0); // no additional margin to the already existing | ||
1404 | 1404 | | |||
rkflx: ? | |||||
1405 | placesViewSplitter = new QSplitter(q); | 1405 | placesViewSplitter = new QSplitter(q); | ||
1406 | placesViewSplitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | 1406 | placesViewSplitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | ||
1407 | placesViewSplitter->setChildrenCollapsible(false); | 1407 | placesViewSplitter->setChildrenCollapsible(false); | ||
1408 | boxLayout->addWidget(placesViewSplitter); | 1408 | boxLayout->addWidget(placesViewSplitter); | ||
1409 | 1409 | | |||
1410 | QObject::connect(placesViewSplitter, SIGNAL(splitterMoved(int,int)), | 1410 | QObject::connect(placesViewSplitter, SIGNAL(splitterMoved(int,int)), | ||
1411 | q, SLOT(_k_placesViewSplitterMoved(int,int))); | 1411 | q, SLOT(_k_placesViewSplitterMoved(int,int))); | ||
1412 | placesViewSplitter->insertWidget(0, opsWidget); | 1412 | placesViewSplitter->insertWidget(0, opsWidget); | ||
▲ Show 20 Lines • Show All 1455 Lines • Show Last 20 Lines |
?