Logo Search packages:      
Sourcecode: basket version File versions  Download package

SettingsDialog::SettingsDialog ( QWidget *  parent = 0  ) 

SettingsDialog

Definition at line 287 of file settings.cpp.

References Settings::isTextUseProg(), LinkLook::soundLook, and Settings::tabsOnTop().

 : KDialogBase(KDialogBase::IconList, i18n("Configure"),
               KDialogBase::Default | KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel, KDialogBase::Ok, parent)
{
      QFrame *page1 = addPage( i18n("General"),              QString::null, DesktopIcon("basket",     KIcon::SizeMedium) );
      QFrame *page5 = addPage( i18n("Items Default Values"), QString::null, DesktopIcon("edit",       KIcon::SizeMedium) );
      QFrame *page3 = addPage( i18n("Items Look"),           QString::null, DesktopIcon("colorize"/*"appearance"*/, KIcon::SizeMedium) );
      QFrame *page4 = addPage( i18n("Applications"),         QString::null, DesktopIcon("run",        KIcon::SizeMedium) );
      QFrame *page6 = addPage( i18n("Addictive Features"),   QString::null, DesktopIcon("package_utilities",
                                                                                                      KIcon::SizeMedium) );

      /* Main Window page */
      QVBoxLayout *layout = new QVBoxLayout(page1, 0, 6);

      m_useSystray = new QCheckBox(i18n("Doc&k BasKet in system tray"), page1);
      m_useSystray->setChecked(Settings::useSystray());
      layout->addWidget(m_useSystray);

      m_showItemsToolTip = new QCheckBox(i18n("Show ite&ms tooltips"), page1);
      m_showItemsToolTip->setChecked(Settings::showItemsToolTip());
      layout->addWidget(m_showItemsToolTip);

      m_instantToolTips = new QCheckBox(i18n("Show tooltips i&nstantaneously"), page1);
      m_instantToolTips->setChecked(Settings::instantToolTips());
      layout->addWidget(m_instantToolTips);

      m_usePassivePopup = new QCheckBox(i18n("Use baloons to re&port result of global actions"), page1);
      m_usePassivePopup->setChecked(Settings::usePassivePopup());
      layout->addWidget(m_usePassivePopup);

      m_useInlineEditors = new QCheckBox(i18n("Use &inline editors for text and rich text items"), page1);
      m_useInlineEditors->setChecked(Settings::useInlineEditors());
      layout->addWidget(m_useInlineEditors);

      QGridLayout *gl = new QGridLayout(layout, 3, 3);
      gl->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 2);

      m_tabsOnTop = new QComboBox(page1);
      m_tabsOnTop->insertItem(i18n("On top"));
      m_tabsOnTop->insertItem(i18n("On bottom"));
      m_tabsOnTop->setCurrentItem( (int)!Settings::tabsOnTop() );
      QLabel *label1 = new QLabel(m_tabsOnTop, i18n("&Tabs bar position:"), page1);
      gl->addWidget(label1,      0, 0);
      gl->addWidget(m_tabsOnTop, 0, 1);

      m_searchOnTop = new QComboBox(page1);
      m_searchOnTop->insertItem(i18n("On top"));
      m_searchOnTop->insertItem(i18n("On bottom"));
      m_searchOnTop->setCurrentItem( (int)!Settings::searchOnTop() );
      QLabel *label9 = new QLabel(m_searchOnTop, i18n("Search &bar position:"), page1);
      gl->addWidget(label9,        1, 0);
      gl->addWidget(m_searchOnTop, 1, 1);

      m_clickConf = new QComboBox(page1);
      m_clickConf->insertItem( i18n("Single click (mouse hover to select them)")             );
      m_clickConf->insertItem( i18n("Double click (single click to select them)")            );
      m_clickConf->insertItem( i18n("Follow KDE wide settings (%1)")
            .arg(KGlobalSettings::singleClick() ? i18n("single click") : i18n("double click")) );
      m_clickConf->setCurrentItem(Settings::clickConf());
      connect( m_clickConf, SIGNAL(activated(int)), this, SLOT(clickConfChanged(int)) );
      QLabel *labelX = new QLabel(m_clickConf, i18n("&Launch items actions:"), page1);
      gl->addWidget(labelX,      2, 0);
      gl->addWidget(m_clickConf, 2, 1);

      // Item Click Copy:
      m_gbClickToCopy = new QGroupBox(4, Qt::Vertical, "****", page1); // "****": will be replaced in clickConfChanged(int)
      QRadioButton *r1 = new QRadioButton(i18n("Copy the item to clipboa&rd"), m_gbClickToCopy);
      QRadioButton *r2 = new QRadioButton(i18n("Copy the item to &selection"), m_gbClickToCopy);
      m_itemClickCopy = new QButtonGroup();
      m_itemClickCopy->insert(r1);
      m_itemClickCopy->insert(r2);
      m_itemClickCopy->setButton(Settings::clickCopyToSelection());
      m_lblClickToCopy = new QLabel("****", m_gbClickToCopy); // "****": will be replaced in clickConfChanged(int)

      KURLLabel *help = new KURLLabel(m_gbClickToCopy);
      help->setText(i18n("What is the selection?"));
      m_helpLabel = help;
      connect( help, SIGNAL(leftClickedURL()), this, SLOT(showSelectionHelp())   );

      layout->addWidget(m_gbClickToCopy);

      layout->insertStretch(-1);

      /* Items Default Values page */
      setupItemsDefaultValuesPage(page5);

      /* Links page */
      QVBoxLayout *layout3 = new QVBoxLayout(page3, 0, 6);
      QLabel *label3 = new QLabel(i18n("Customize look of file, sound, link and launcher items:"), page3);
      QTabWidget *tabs = new QTabWidget(page3);
      layout3->addWidget(label3);
      layout3->addWidget(tabs);

      m_soundLC = new LinkLookEditWidget(LinkLook::soundLook, i18n("Conference audio record"), "sound",       tabs);
      m_fileLC  = new LinkLookEditWidget(LinkLook::fileLook,  i18n("Annual report"),           "document",    tabs);
      m_localLC = new LinkLookEditWidget(LinkLook::localLook, i18n("Home folder"),             "folder_home", tabs);
      m_urlLC   = new LinkLookEditWidget(LinkLook::urlLook,        "www.kde.org",              "www",         tabs);
      m_noUrlLC = new LinkLookEditWidget(LinkLook::noUrlLook, i18n("Launch BasKet"),           "basket",      tabs);
      tabs->addTab(m_soundLC, i18n("&Sounds")       );
      tabs->addTab(m_fileLC,  i18n("&Files")        );
      tabs->addTab(m_localLC, i18n("&Local Links")  );
      tabs->addTab(m_urlLC,   i18n("&Network Links"));
      tabs->addTab(m_noUrlLC, i18n("Launc&hers")    );

      /* Applications page */
      QVBoxLayout *layout4 = new QVBoxLayout(page4, 0, 6);

      m_textUseProg  = new QCheckBox(i18n("Open &text items with a custom application:"), page4);
      m_textProg     = new RunCommandRequester(Settings::textProg(), i18n("Open text items with:"), page4);
      m_textUseProg->setChecked(Settings::isTextUseProg());
      m_textProg->setEnabled(Settings::isTextUseProg());
      QHBoxLayout *hLayT = new QHBoxLayout(0, 0, 6);
      hLayT->insertSpacing(-1, 20);
      hLayT->addWidget(m_textProg);

      m_htmlUseProg  = new QCheckBox(i18n("Open &rich text items with a custom application:"), page4);
      m_htmlProg     = new RunCommandRequester(Settings::htmlProg(), i18n("Open rich text items with:"), page4);
      m_htmlUseProg->setChecked(Settings::isHtmlUseProg());
      m_htmlProg->setEnabled(Settings::isHtmlUseProg());
      QHBoxLayout *hLayH = new QHBoxLayout(0, 0, 6);
      hLayH->insertSpacing(-1, 20);
      hLayH->addWidget(m_htmlProg);

      m_imageUseProg = new QCheckBox(i18n("Open &image items with a custom application:"), page4);
      m_imageProg    = new RunCommandRequester(Settings::imageProg(), i18n("Open image items with:"), page4);
      m_imageUseProg->setChecked(Settings::isImageUseProg());
      m_imageProg->setEnabled(Settings::isImageUseProg());
      QHBoxLayout *hLayI = new QHBoxLayout(0, 0, 6);
      hLayI->insertSpacing(-1, 20);
      hLayI->addWidget(m_imageProg);

      m_animationUseProg = new QCheckBox(i18n("Open a&nimation items with a custom application:"), page4);
      m_animationProg    = new RunCommandRequester(Settings::animationProg(), i18n("Open animation items with:"), page4);
      m_animationUseProg->setChecked(Settings::isAnimationUseProg());
      m_animationProg->setEnabled(Settings::isAnimationUseProg());
      QHBoxLayout *hLayA = new QHBoxLayout(0, 0, 6);
      hLayA->insertSpacing(-1, 20);
      hLayA->addWidget(m_animationProg);

      m_soundUseProg = new QCheckBox(i18n("Open so&und items with a custom application:"), page4);
      m_soundProg    = new RunCommandRequester(Settings::soundProg(), i18n("Open sound items with:"), page4);
      m_soundUseProg->setChecked(Settings::isSoundUseProg());
      m_soundProg->setEnabled(Settings::isSoundUseProg());
      QHBoxLayout *hLayS = new QHBoxLayout(0, 0, 6);
      hLayS->insertSpacing(-1, 20);
      hLayS->addWidget(m_soundProg);

      QString whatsthis = i18n(
            "<p>If checked, the application defined below will be used when openning that type of item.</p>"
            "<p>Otherwise, the application you've configured to in Konqueror will be used.</p>");

      QWhatsThis::add(m_textUseProg,      whatsthis);
      QWhatsThis::add(m_htmlUseProg,      whatsthis);
      QWhatsThis::add(m_imageUseProg,     whatsthis);
      QWhatsThis::add(m_animationUseProg, whatsthis);
      QWhatsThis::add(m_soundUseProg,     whatsthis);

      whatsthis = i18n(
            "<p>Define the application to use for openning that type of item instead of the "
            "application configured in Konqueror.</p>");

      QWhatsThis::add(m_textProg,      whatsthis);
      QWhatsThis::add(m_htmlProg,      whatsthis);
      QWhatsThis::add(m_imageProg,     whatsthis);
      QWhatsThis::add(m_animationProg, whatsthis);
      QWhatsThis::add(m_soundProg,     whatsthis);

      layout4->addWidget(m_textUseProg);
      layout4->addItem(hLayT);
      layout4->addWidget(m_htmlUseProg);
      layout4->addItem(hLayH);
      layout4->addWidget(m_imageUseProg);
      layout4->addItem(hLayI);
      layout4->addWidget(m_animationUseProg);
      layout4->addItem(hLayA);
      layout4->addWidget(m_soundUseProg);
      layout4->addItem(hLayS);
      layout4->insertStretch(-1);

      connect( m_textUseProg,      SIGNAL(toggled(bool)), m_textProg,      SLOT(setEnabled(bool)) );
      connect( m_htmlUseProg,      SIGNAL(toggled(bool)), m_htmlProg,      SLOT(setEnabled(bool)) );
      connect( m_imageUseProg,     SIGNAL(toggled(bool)), m_imageProg,     SLOT(setEnabled(bool)) );
      connect( m_animationUseProg, SIGNAL(toggled(bool)), m_animationProg, SLOT(setEnabled(bool)) );
      connect( m_soundUseProg,     SIGNAL(toggled(bool)), m_soundProg,     SLOT(setEnabled(bool)) );

      /* Addicitive features */
      QVBoxLayout *layout6 = new QVBoxLayout(page6, 0, 6);

      layout6->addWidget( new QLabel(i18n("This page group non-standard options that, once learned,\n"
                                          "can be very powerful and time saving in the context of BasKet:"), page6) );

      m_onlyBasketsIcon = new QCheckBox(i18n("&Hide name of baskets with icons in the tabs bar"), page6);
      m_onlyBasketsIcon->setChecked(Settings::onlyBasketsIcon());
      layout6->addWidget(m_onlyBasketsIcon);

      m_enterValidateInlineWidget = new QWidget(page6);
      QHBoxLayout *hLayV = new QHBoxLayout(m_enterValidateInlineWidget, 0, 6);
      m_enterValidateInline = new QCheckBox(i18n("&Validate with Return in inline editors"), m_enterValidateInlineWidget);
      m_enterValidateInline->setChecked(Settings::enterValidateInline());
      KURLLabel *helpV = new KURLLabel(m_enterValidateInlineWidget);
      helpV->setText(i18n("How to insert new lines?"));
      connect( helpV, SIGNAL(leftClickedURL()), this, SLOT(showNewLineHelp()) );
      hLayV->addWidget(m_enterValidateInline);
      hLayV->addWidget(helpV);
      hLayV->insertStretch(-1);
      layout6->addWidget(m_enterValidateInlineWidget);
      m_enterValidateInlineWidget->setEnabled(m_useInlineEditors->isChecked());
      connect( m_useInlineEditors, SIGNAL(toggled(bool)), m_enterValidateInlineWidget, SLOT(setEnabled(bool)) );

      QGridLayout *ga = new QGridLayout(layout6, 3, 4);
      ga->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 3);

      m_middleAction = new QComboBox(page6);
      m_middleAction->insertItem( i18n("Do nothing")            );
      m_middleAction->insertItem( i18n("Paste clipboard")       );
      m_middleAction->insertItem( i18n("Insert text item")      );
      m_middleAction->insertItem( i18n("Insert rich text item") );
      m_middleAction->insertItem( i18n("Insert image item")     );
      m_middleAction->insertItem( i18n("Insert link item")      );
      m_middleAction->insertItem( i18n("Insert launcher item")  );
      m_middleAction->insertItem( i18n("Insert color item")     );
      m_middleAction->setCurrentItem(Settings::middleAction());
      QLabel *labelM = new QLabel(m_middleAction, i18n("&Shift+middle-click:"), page6);
      ga->addWidget(labelM,                                         0, 0);
      ga->addWidget(m_middleAction,                                 0, 1);
      ga->addWidget(new QLabel(i18n("at cursor position"), page6),  0, 2);

      m_writingAction = new QComboBox(page6);
      m_writingAction->insertItem( i18n("Do nothing")            );
      m_writingAction->insertItem( i18n("Search")                );
      m_writingAction->insertItem( i18n("Insert text item")      );
      m_writingAction->insertItem( i18n("Insert rich text item") );
      m_writingAction->insertItem( i18n("Insert link item")      );
      m_writingAction->setCurrentItem(Settings::writingAction());
      QLabel *labelY = new QLabel(m_writingAction, i18n("&When writing in a basket:"), page6);
      ga->addWidget(labelY,          1, 0);
      ga->addWidget(m_writingAction, 1, 1);

      m_writingCommaAction = new QComboBox(page6);
      m_writingCommaAction->insertItem( i18n("Do the same")           );
      m_writingCommaAction->insertItem( i18n("Search")                );
      m_writingCommaAction->insertItem( i18n("Insert text item")      );
      m_writingCommaAction->insertItem( i18n("Insert rich text item") );
      m_writingCommaAction->insertItem( i18n("Insert link item")      );
      m_writingCommaAction->setCurrentItem(Settings::writingCommaAction());
      QLabel *labelZ = new QLabel(m_writingCommaAction, i18n("&But begin writting with a comma (,):"), page6);
      ga->addWidget(labelZ,               2, 0);
      ga->addWidget(m_writingCommaAction, 2, 1);

      QGroupBox *gbSys = new QGroupBox(3, Qt::Vertical, i18n("System Tray Icon"), page6);
      layout6->addWidget(gbSys);

      m_systray = new QWidget(gbSys);
      QVBoxLayout *sysLay = new QVBoxLayout(m_systray, 0, 6);

      m_showIconInSystray = new QCheckBox(i18n("Show c&urrent basket icon in system tray"), m_systray);
      sysLay->addWidget(m_showIconInSystray);

      QGridLayout *gs = new QGridLayout(sysLay, 2, 3);
      gs->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 2);

      m_hideOnMouseOut = new QCheckBox(i18n("H&ide main window when mouse go out of it for"), m_systray);
      m_timeToHideOnMouseOut = new KIntNumInput(Settings::timeToHideOnMouseOut(), m_systray);
      m_timeToHideOnMouseOut->setRange(0, 600, 1, false);
      m_timeToHideOnMouseOut->setSuffix(i18n(" tenths of seconds"));
      gs->addWidget(m_hideOnMouseOut,       0, 0);
      gs->addWidget(m_timeToHideOnMouseOut, 0, 1);

      m_showOnMouseIn  = new QCheckBox(i18n("Show &main window when mouse hover the systray icon for"), m_systray);
      m_timeToShowOnMouseIn = new KIntNumInput(Settings::timeToShowOnMouseIn(), m_systray);
      m_timeToShowOnMouseIn->setRange(0, 600, 1, false);
      m_timeToShowOnMouseIn->setSuffix(i18n(" tenths of seconds"));
      gs->addWidget(m_showOnMouseIn,       1, 0);
      gs->addWidget(m_timeToShowOnMouseIn, 1, 1);

      layout6->insertStretch(-1);

      connect( m_useSystray,     SIGNAL(toggled(bool)), gbSys,                  SLOT(setEnabled(bool)) );
      connect( m_hideOnMouseOut, SIGNAL(toggled(bool)), m_timeToHideOnMouseOut, SLOT(setEnabled(bool)) );
      connect( m_showOnMouseIn,  SIGNAL(toggled(bool)), m_timeToShowOnMouseIn,  SLOT(setEnabled(bool)) );

      clickConfChanged(m_clickConf->currentItem());

      m_showIconInSystray->setChecked(    Settings::showIconInSystray()  );
      m_hideOnMouseOut->setChecked(       Settings::hideOnMouseOut()     );
      m_showOnMouseIn->setChecked(        Settings::showOnMouseIn()      );

      m_systray->setEnabled(              Settings::useSystray()         );
      m_timeToHideOnMouseOut->setEnabled( Settings::hideOnMouseOut()     );
      m_timeToShowOnMouseIn->setEnabled(  Settings::showOnMouseIn()      );
}


Generated by  Doxygen 1.6.0   Back to index