void Posture::toPosture(const QString &name) { if (modelList.size() == 0) m_iListPage = 0; if ((m_iListPage >= modelList.size() / MAXATONCE && modelList.size() % MAXATONCE == 0) || (modelList.size() % MAXATONCE != 0 && m_iListPage > modelList.size() / MAXATONCE)) { if (name != "") m_pmPageManager.GetModelByUserID(modelList, name.toStdString(), m_iListPage*MAXATONCE); else m_pmPageManager.GetModelByUserID(modelList, g_umUserManager.GetUsername(), m_iListPage*MAXATONCE); } int end = (m_iListPage + 1)*MAXATONCE < modelList.size() ? (m_iListPage + 1)*MAXATONCE : modelList.size(); m_iListPage = (end - 1) / MAXATONCE; m_plwPosWin = new PostureListWindow(this, name, m_iListPage*MAXATONCE, end, modelList); CloseCurrentWindow(); m_wtCurrentWin = POSTURELIST; this->setCentralWidget(m_plwPosWin); connect(m_plwPosWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_plwPosWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_plwPosWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_plwPosWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_plwPosWin, SIGNAL(display(const ModelVideo&)), this, SLOT(toDisplay(const ModelVideo&))); connect(m_plwPosWin, SIGNAL(prev(const QString&)), this, SLOT(prevList(const QString&))); connect(m_plwPosWin, SIGNAL(next(const QString&)), this, SLOT(nextList(const QString&))); }
void Posture::toUploadInfo(const QString &mode) { CloseCurrentWindow(); m_uiwInfoWin = new UploadInfoWindow(this,mode); m_wtCurrentWin = UPLOADINFO; this->setCentralWidget(m_uiwInfoWin); connect(m_uiwInfoWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_uiwInfoWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_uiwInfoWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_uiwInfoWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_uiwInfoWin, SIGNAL(toHomeWin()), this, SLOT(firstToHome())); }
void Posture::toSearch() { CloseCurrentWindow(); modelList.clear(); m_swSearchWin = new SearchWindow(this); m_wtCurrentWin = SEARCH; connect(m_swSearchWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_swSearchWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_swSearchWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_swSearchWin, SIGNAL(logout()), this, SLOT(logout())); //this->setCentralWidget(m_swSearchWin); }
void Posture::toFriends(const QString &name) { CloseCurrentWindow(); modelList.clear(); m_fwFriendsWin = new FriendsWindow(this, name); m_wtCurrentWin = FRIENDS; this->setCentralWidget(m_fwFriendsWin); connect(m_fwFriendsWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_fwFriendsWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_fwFriendsWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_fwFriendsWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_fwFriendsWin, SIGNAL(toFriends(const QString&)), this, SLOT(toFriends(const QString&))); }
void Posture::toUploadMode() { CloseCurrentWindow(); modelList.clear(); m_umwUpWin = new UploadModeWindow(this); m_wtCurrentWin = UPLOADMODE; connect(m_umwUpWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_umwUpWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_umwUpWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_umwUpWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_umwUpWin, SIGNAL(toUpload(const QString&)), this, SLOT(toUpload(const QString&))); this->setCentralWidget(m_umwUpWin); }
void Posture::toProfileEdit() { CloseCurrentWindow(); modelList.clear(); m_pewEditWin = new ProfileEditWindow(this); m_wtCurrentWin = PROFILEEDIT; connect(m_pewEditWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_pewEditWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_pewEditWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_pewEditWin, SIGNAL(cancel(const QString&)), this, SLOT(toProfile(const QString&))); connect(m_pewEditWin, SIGNAL(success(const QString&)), this, SLOT(toProfile(const QString&))); connect(m_pewEditWin, SIGNAL(logout()), this, SLOT(logout())); this->setCentralWidget(m_pewEditWin); }
void Posture::toProfile(const QString &name) { CloseCurrentWindow(); modelList.clear(); m_pwProfileWin = new ProfileWindow(this,name); m_wtCurrentWin = PROFILE; connect(m_pwProfileWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_pwProfileWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_pwProfileWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_pwProfileWin, SIGNAL(edit()), this, SLOT(toProfileEdit())); connect(m_pwProfileWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_pwProfileWin, SIGNAL(addTag()), this, SLOT(toTag())); this->setCentralWidget(m_pwProfileWin); }
void Posture::toDisplay(const ModelVideo &model) { CloseCurrentWindow(); modelList.clear(); m_dwDisWin = new DisplayWindow(this, model); m_wtCurrentWin = DISPLAY; connect(m_dwDisWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_dwDisWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_dwDisWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_dwDisWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_dwDisWin, SIGNAL(updateModel(const ModelVideo&)), this, SLOT(updateModel(const ModelVideo&))); connect(m_dwDisWin, SIGNAL(comment(const ModelVideo&)), this, SLOT(toComment(const ModelVideo&))); this->setCentralWidget(m_dwDisWin); }
void BrowserDock::polish() { m_categoryList.data()->setIcon( KIcon( "user-home" ) ); m_categoryList.data()->setMinimumSize( 100, 300 ); connect( m_breadcrumbWidget, SIGNAL(toHome()), this, SLOT(home()) ); // Keyboard shortcut for going back one level KAction *action = new KAction( KIcon( "go-up" ), i18n( "Go Up in Media Sources Pane" ), m_mainWidget ); Amarok::actionCollection()->addAction( "browser_previous", action ); connect( action, SIGNAL(triggered(bool)), m_categoryList.data(), SLOT(back()) ); action->setShortcut( KShortcut( Qt::Key_Backspace ) ); paletteChanged( palette() ); connect( The::paletteHandler(), SIGNAL(newPalette(QPalette)), SLOT(paletteChanged(QPalette)) ); }
void Posture::toWelcome(int i) { int count = 0; ModelVideo model; if (i > models.size() - 1 || i == -1) { if (i == -1) models.clear(); m_pmPageManager.GetModel(models, i); if (i != -1) { m_iPage = i / MAXATONCE; count = models.size() - (m_iPage)*MAXATONCE; } else { i = 0; m_iPage = 0; count = models.size(); } } else { m_iPage = i / MAXATONCE; if (models.size() < i + MAXATONCE) { count = models.size() - i; } else { count = MAXATONCE; } } switch (count) { case 0: return; case 1: m_wwPosWin = new WelcomeWindow(this, count, models[i], model, model, model); CloseCurrentWindow(); break; case 2: m_wwPosWin = new WelcomeWindow(this, count, models[i], models[i+1], model, model); CloseCurrentWindow(); break; case 3: m_wwPosWin = new WelcomeWindow(this, count, models[i], models[i+1], models[i+2], model); CloseCurrentWindow(); break; case 4: m_wwPosWin = new WelcomeWindow(this, count, models[i], models[i+1], models[i+2], models[i+3]); CloseCurrentWindow(); break; } this->setCentralWidget(m_wwPosWin); m_wtCurrentWin = WELCOME; modelList.clear(); connect(m_wwPosWin, SIGNAL(display(const ModelVideo&)), this, SLOT(toDisplay(const ModelVideo&))); connect(m_wwPosWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_wwPosWin, SIGNAL(prev()), this, SLOT(prevWelcome())); connect(m_wwPosWin, SIGNAL(next()), this, SLOT(nextWelcome())); connect(m_wwPosWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_wwPosWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_wwPosWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_wwPosWin, SIGNAL(refresh()), this, SLOT(firstToHome())); this->setFixedSize(WINDOW_W*xscale, WINDOW_H*yscale); this->move((QApplication::desktop()->width() - WINDOW_W*xscale) / 2, (QApplication::desktop()->height() - WINDOW_H*yscale) / 2); }
void EndLivel::on_pushButton_2_clicked() { emit toHome(); this->close(); }