Ejemplo n.º 1
0
TEST(Main_window, active_pane) {
  Core core(true);
  Main_window* mw = core.get_main_window();
  EXPECT_TRUE(mw->get_active_pane() == mw->get_ui()->left_pane ||
              mw->get_active_pane() == mw->get_ui()->right_pane);
  mw->set_active_pane(mw->get_ui()->left_pane);
  EXPECT_TRUE(mw->get_active_pane() == mw->get_ui()->left_pane);

  QSignalSpy spy(mw, SIGNAL(active_pane_changed()));

  mw->set_active_pane(mw->get_ui()->right_pane);
  EXPECT_TRUE(mw->get_active_pane() == mw->get_ui()->right_pane);
  EXPECT_EQ(1, spy.count());

  mw->set_active_pane(0);
  EXPECT_TRUE(mw->get_active_pane() == mw->get_ui()->right_pane);
  EXPECT_EQ(1, spy.count());

  mw->set_active_pane(mw->get_ui()->right_pane);
  EXPECT_TRUE(mw->get_active_pane() == mw->get_ui()->right_pane);
  EXPECT_EQ(1, spy.count());

  mw->set_active_pane(mw->get_ui()->left_pane);
  EXPECT_TRUE(mw->get_active_pane() == mw->get_ui()->left_pane);
  EXPECT_EQ(2, spy.count());

}
Ejemplo n.º 2
0
void Pane::set_main_window(Main_window *p_main_window) {
  main_window = p_main_window;
  connect(main_window, SIGNAL(active_pane_changed()), this, SLOT(active_pane_changed()));
  connect(ui->list, SIGNAL(doubleClicked(QModelIndex)), main_window, SLOT(open_current()));

}