KRename – powerful batch renamer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
4.0KB

  1. /***************************************************************************
  2. confdialog.cpp - description
  3. -------------------
  4. begin : Sun Jan 27 2002
  5. copyright : (C) 2002 by Dominik Seichter
  6. email : domseichter@web.de
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************/
  16. // Own includes
  17. #include "confdialog.h"
  18. // QT includes
  19. #include <tqbuttongroup.h>
  20. #include <tqlabel.h>
  21. #include <tqlayout.h>
  22. #include <tqradiobutton.h>
  23. #include <tqtooltip.h>
  24. // KDE includes
  25. #include <kiconloader.h>
  26. #include <tdelocale.h>
  27. ConfDialog::ConfDialog( TQWidget* parent, const char* name )
  28. : KDialogBase( KDialogBase::IconList, "KRename",
  29. KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Default, KDialogBase::Ok, parent, name, true, true ),
  30. GUIModeSelector()
  31. {
  32. setupTab1();
  33. setupTab2();
  34. connect( this, TQT_SIGNAL( defaultClicked() ), this, TQT_SLOT( defaults() ) );
  35. }
  36. ConfDialog::~ConfDialog()
  37. {
  38. }
  39. void ConfDialog::setupTab1()
  40. {
  41. const TQString caption = i18n("Look and Feel");
  42. TQFrame* box = addPage( caption, caption, BarIcon("preferences-desktop") );
  43. TQVBoxLayout* layout = new TQVBoxLayout( box );
  44. TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
  45. TQButtonGroup* group = new TQButtonGroup( box );
  46. group->setColumnLayout(0, Qt::Vertical );
  47. TQVBoxLayout* lgroup = new TQVBoxLayout( group->layout() );
  48. optionWizard = new TQRadioButton( group );
  49. optionWizard->setText( i18n("Use &wizard style GUI (beginners)") );
  50. optionTabs = new TQRadioButton( group );
  51. optionTabs->setText( i18n("Use &tabbed GUI (advanced users)") );
  52. lgroup->addWidget( new TQLabel( i18n("Configure the look and feel of the KRename GUI:<br>"), group ) );
  53. lgroup->addWidget( optionWizard );
  54. lgroup->addWidget( optionTabs );
  55. lgroup->addItem( spacer );
  56. layout->addWidget( group );
  57. layout->addItem( spacer );
  58. }
  59. void ConfDialog::setupTab2()
  60. {
  61. const TQString caption = i18n("KRename");
  62. TQFrame* box = addPage( caption, caption, BarIcon("krename") );
  63. TQVBoxLayout* layout = new TQVBoxLayout( box );
  64. TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
  65. checkPlugins = new TQCheckBox( i18n("&Load file plugins on start"), box );
  66. checkAutosize = new TQCheckBox( i18n("Auto &resize columns in preview"), box );
  67. spinSize = new KIntNumInput( box );
  68. spinSize->setRange( 20, 500, 1, false );
  69. spinSize->setLabel( i18n( "&Thumbnail size:" ), AlignLeft | AlignVCenter );
  70. spinHistory = new KIntNumInput( box );
  71. spinHistory->setRange( 2, 500, 1, false );
  72. spinHistory->setLabel( i18n( "&Number of template history items:" ), AlignLeft | AlignVCenter );
  73. layout->addWidget( checkPlugins );
  74. layout->addWidget( checkAutosize );
  75. layout->addItem( spacer );
  76. layout->addWidget( spinSize );
  77. layout->addWidget( spinHistory );
  78. layout->addItem( spacer );
  79. TQToolTip::add( checkPlugins, i18n("Disabling this option decreases KRename's startup time, because no KFilePlugins are loaded.") );
  80. }
  81. void ConfDialog::defaults()
  82. {
  83. checkPlugins->setChecked( true );
  84. checkAutosize->setChecked( false );
  85. optionWizard->setChecked( true );
  86. spinSize->setValue( 80 );
  87. }
  88. #include "confdialog.moc"