comparison src/gui/window.cc @ 113:32afe0e940bf

window: remove tiny little debug thing
author Paper <mrpapersonic@gmail.com>
date Mon, 06 Nov 2023 13:48:11 -0500
parents 80f49f623d30
children ab191e28e69d
comparison
equal deleted inserted replaced
112:80f49f623d30 113:32afe0e940bf
113 stack->addWidget(new StatisticsPage(main_widget)); 113 stack->addWidget(new StatisticsPage(main_widget));
114 stack->addWidget(new SearchPage(main_widget)); 114 stack->addWidget(new SearchPage(main_widget));
115 stack->addWidget(new SeasonsPage(main_widget)); 115 stack->addWidget(new SeasonsPage(main_widget));
116 stack->addWidget(new TorrentsPage(main_widget)); 116 stack->addWidget(new TorrentsPage(main_widget));
117 117
118 connect(sidebar, &SideBar::CurrentItemChanged, this, [](int index){
119 std::cout << index << std::endl;
120 });
121
122 connect(sidebar, &SideBar::CurrentItemChanged, stack, &QStackedWidget::setCurrentIndex); 118 connect(sidebar, &SideBar::CurrentItemChanged, stack, &QStackedWidget::setCurrentIndex);
123 sidebar->SetCurrentItem(page); 119 sidebar->SetCurrentItem(page);
124 120
125 main_widget->layout()->addWidget(sidebar); 121 main_widget->layout()->addWidget(sidebar);
126 main_widget->layout()->addWidget(stack); 122 main_widget->layout()->addWidget(stack);
311 reinterpret_cast<AnimeListPage*>(stack->widget(static_cast<int>(Pages::ANIME_LIST)))->Refresh(); 307 reinterpret_cast<AnimeListPage*>(stack->widget(static_cast<int>(Pages::ANIME_LIST)))->Refresh();
312 }); 308 });
313 } 309 }
314 310
315 void MainWindow::RetranslateUI() { 311 void MainWindow::RetranslateUI() {
316 /* Temporarily disable UI updates so we don't flash the screen */ 312 /* This kinda sucks but nobody's really going to be changing
313 the application language all the time :p */
317 setUpdatesEnabled(false); 314 setUpdatesEnabled(false);
318 AddMainWidgets(); 315 AddMainWidgets();
319 CreateBars(); 316 CreateBars();
320 setUpdatesEnabled(true); 317 setUpdatesEnabled(true);
321 } 318 }