rusificationwidget.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "gui\rusificationwidget.h"
  2. #include "ui_rusificationwidget.h"
  3. void doStuffWithEveryItemInMyTree( QTreeWidgetItem *item )
  4. {
  5. item->setCheckState(0, Qt::Checked);
  6. for( int i = 0; i < item->childCount(); ++i )
  7. doStuffWithEveryItemInMyTree( item->child(i) );
  8. }
  9. RusificationWidget::RusificationWidget(LegacyApp *_app, QWidget *parent) :
  10. QWidget(parent),
  11. ui(new Ui::RusificationWidget),
  12. app(_app)
  13. {
  14. ui->setupUi(this);
  15. ui->treeWidget->expandAll();
  16. hide_all_import_widgets();
  17. doStuffWithEveryItemInMyTree(ui->treeWidget->invisibleRootItem());
  18. }
  19. RusificationWidget::~RusificationWidget()
  20. {
  21. delete ui;
  22. }
  23. void RusificationWidget::hide_all_import_widgets()
  24. {
  25. ui->database_import_widget->hide();
  26. ui->file_import_widget->hide();
  27. ui->textfragment_import_widget->hide();
  28. }
  29. void RusificationWidget::on_database_import_radiobutton_clicked()
  30. {
  31. hide_all_import_widgets();
  32. ui->database_import_widget->show();
  33. }
  34. void RusificationWidget::on_file_import_radiobutton_clicked()
  35. {
  36. hide_all_import_widgets();
  37. ui->file_import_widget->show();
  38. }
  39. void RusificationWidget::on_textfragment_import_radiobutton_clicked()
  40. {
  41. hide_all_import_widgets();
  42. ui->textfragment_import_widget->show();
  43. }