void TransferView::onTransferUpdate() { StreamConnection* sc = (StreamConnection*)sender(); // qDebug() << Q_FUNC_INFO << sc->track().isNull() << sc->source().isNull(); if ( sc->track().isNull() || sc->source().isNull() ) return; QTreeWidgetItem* ti = 0; if ( m_index.contains( sc ) ) { QPersistentModelIndex i = m_index.value( sc ); ti = m_tree->invisibleRootItem()->child( i.row() ); } else { ti = new QTreeWidgetItem( m_tree ); m_index.insert( sc, QPersistentModelIndex( m_tree->model()->index( m_tree->invisibleRootItem()->childCount() - 1, 0 ) ) ); emit showWidget(); } if ( !ti ) return; ti->setText( 0, sc->source()->friendlyName() ); ti->setText( 1, QString( "%1 kb/s" ).arg( sc->transferRate() / 1024 ) ); ti->setText( 2, QString( "%1 - %2" ).arg( sc->track()->artist()->name() ).arg( sc->track()->track() ) ); if ( isHidden() ) emit showWidget(); }
void SWidgetManager::switchWidgetVisiblity( QWidget *widget ) { if( widgetIsVisible(widget) ) hideWidget(widget); else showWidget(widget); }
void AlertToneWidget::clicked () { int dcpWidgetId = (SoundSettingsApplet::AlertToneBrowser_id * 65536) + m_idx; emit showWidget (dcpWidgetId); }
void MainWindow::hideWaitingWidget() { if (widgetIndexBeforeWaiting >= 0) { waitingWidget->stopWaitingTimer(); showWidget((MainWindow::ScreenWidget) widgetIndexBeforeWaiting); widgetIndexBeforeWaiting = -1; } }
void MainWindow::cancelWaitingWidget() { if (widgetIndexBeforeWaiting >= 0) { waitingWidget->stopWaitingTimer(); showWidget((MainWindow::ScreenWidget) widgetIndexBeforeWaiting); dynamic_cast<ServerWidget*>(stackedWidget->currentWidget())->onRequestCancelled(); widgetIndexBeforeWaiting = -1; } }
void LoginPanel::initPanel() { showWidget(CREATE_REGISTER_PLAYER,false,false,true); nameBtn = getButtonFromeWidgetWithWidgetName(rootWidget, COMMON_LAYOUT, "nameBtn"); loginBtn = getButtonFromeWidgetWithWidgetName(rootWidget, COMMON_LAYOUT, "loginBtn"); autoLoginCheckBox = mvc::UITool::getCheckBoxFromWidgetWithName(rootWidget, COMMON_LAYOUT, "autoLoginCheckBox"); autoLoginCheckBox->addEventListenerCheckBox(this, cocos2d::ui::SEL_SelectedStateEvent(&LoginPanel::onCheckBoxHandler)); passwordCheckBox = mvc::UITool::getCheckBoxFromWidgetWithName(rootWidget, COMMON_LAYOUT, "passwordCheckBox"); passwordCheckBox->addEventListenerCheckBox(this, cocos2d::ui::SEL_SelectedStateEvent(&LoginPanel::onCheckBoxHandler)); nameTf = mvc::UITool::getTextFieldFromWidgetWithName(rootWidget, COMMON_LAYOUT, "nameTf"); nameTf->addEventListenerTextField(this, cocos2d::ui::SEL_TextFieldEvent(&LoginPanel::onTextFiledHandler)); passwordTf = mvc::UITool::getTextFieldFromWidgetWithName(rootWidget, COMMON_LAYOUT, "passwordTf"); passwordTf->addEventListenerTextField(this, cocos2d::ui::SEL_TextFieldEvent(&LoginPanel::onTextFiledHandler)); commonLayout = mvc::UITool::getLayoutFromWidget(rootWidget, COMMON_LAYOUT); isAutoLogin = LOCAL_SAVE->getBoolForKey(AUTO_LOGIN_GAME); isRemeberPassword = LOCAL_SAVE->getBoolForKey(REMEBER_GAME_PASSWORD); if(isRemeberPassword) { nameTf->setText(LOCAL_SAVE->getStringForKey(PLAYER_NAME)); passwordTf->setText(LOCAL_SAVE->getStringForKey(PLAYER_PASSWORD)); CCLOG("save name is %s",LOCAL_SAVE->getStringForKey(PLAYER_NAME).c_str()); CCLOG("save password is %s",LOCAL_SAVE->getStringForKey(PLAYER_PASSWORD).c_str()); } if(isAutoLogin) { //publishEvent(LOGIN_GAME); } autoLoginCheckBox->setSelectedState(isAutoLogin); passwordCheckBox->setSelectedState(isRemeberPassword); // BaseUIFrame* frame = BaseUIFrame::create(); // frame->setFrameSize(800, 600); // this->addChild(frame); // frame->setPosition(cocos2d::Point(200,100)); // auto ball = cocos2d::Sprite::create("jump.png"); // auto node = cocos2d::Node::create(); // node->setScale(4.0f); // node->addChild(ball); // node->setAnchorPoint(cocos2d::Point(0.0f,0.0f)); // node->setPosition(300, 300); // this->addChild(node); // // node->runAction(cocos2d::ScaleTo::create(5, 0.2)); }
void MainWidget::iconIsActived(QSystemTrayIcon::ActivationReason reason) { switch(reason) { //点击托盘图标之后松开 case QSystemTrayIcon::Trigger: { showWidget(); break; } //双击托盘图标 case QSystemTrayIcon::DoubleClick: { showWidget(); break; } default: break; } }
void AnimatedSplitter::addWidget( AnimatedWidget* widget ) { qDebug() << Q_FUNC_INFO << widget; QSplitter::addWidget( widget ); m_sizes << widget->hiddenSize(); connect( widget, SIGNAL( showWidget() ), SLOT( onShowRequest() ) ); connect( widget, SIGNAL( hideWidget() ), SLOT( onHideRequest() ) ); connect( widget, SIGNAL( hiddenSizeChanged() ), SLOT( onHiddenSizeChanged() ) ); connect( this, SIGNAL( shown( QWidget* ) ), widget, SLOT( onShown( QWidget* ) ) ); connect( this, SIGNAL( hidden( QWidget* ) ), widget, SLOT( onHidden( QWidget* ) ) ); }
void AnimatedSplitter::addWidget( AnimatedWidget* widget ) { QSplitter::addWidget( widget ); connect( widget, SIGNAL( showWidget() ), SLOT( onShowRequest() ) ); connect( widget, SIGNAL( hideWidget() ), SLOT( onHideRequest() ) ); connect( widget, SIGNAL( sizeHintChanged( QSize ) ), SLOT( onShowRequest() ) ); connect( widget, SIGNAL( sizeChanged( QSize ) ), SLOT( onSizeChanged( QSize ) ) ); connect( this, SIGNAL( shown( QWidget*, bool ) ), widget, SLOT( onShown( QWidget*, bool ) ) ); connect( this, SIGNAL( hidden( QWidget*, bool ) ), widget, SLOT( onHidden( QWidget*, bool ) ) ); }
void SystemTray::createAction() { setIcon(QIcon(":/main/inno")); m_pMenu = new QMenu(); m_pActOpen = new QAction(this); m_pActLayout = new QAction(this); setContextMenu(m_pMenu); m_pMenu->setFixedWidth(100); connect( m_pActOpen, SIGNAL(triggered()), this, SIGNAL(showWidget())); connect (m_pActLayout, SIGNAL(triggered()), parent(), SLOT(close())); }
void XWidget::paint() { setClipRect(widget_rect); //重绘制父组件 if(lucency && parent) { parent->drawParent(widget_rectF,this); } draw(); //子组件 if(layout) layout->drawChild(widget_rectF,this); showWidget(); cleanClipRect(); }
void Sidebar::tabClicked(int i) { ToolView *w = m_idToWidget[i]; if (!w) return; if (isTabRaised(i)) { showWidget (w); w->setFocus (); } else { hideWidget (w); m_mainWin->centralWidget()->setFocus (); } }
void SystemTray::createAction() { this->setIcon(QIcon(":/icon/logo")); tray_menu = new QMenu(); action_open = new QAction(this); action_help_center = new QAction(this); action_login = new QAction(this); action_separate = new QAction(this); action_logout = new QAction(this); tray_menu->setFixedWidth(250); connect(action_open, SIGNAL(triggered()), this, SIGNAL(showWidget())); connect(action_logout, SIGNAL(triggered()), qApp, SLOT(quit())); this->setContextMenu(tray_menu); }
void XWidget::onPaint(Uint16 msg) { switch(msg) { case X_PAINT: case X_UPDATE: { onDrawBackground(widget_rectF); if(layout) layout->drawChild(widget_rectF,this); showWidget(); } break; case X_RELAYOUT: { } } }
UserWidget::UserWidget(QWidget *parent) : QWidget(parent), m_showAnimation(new QPropertyAnimation), m_hideAnimation(new QPropertyAnimation) { m_Layout = new QHBoxLayout; m_Layout->setMargin(0); m_Layout->addSpacing(0); m_showAnimation->setPropertyName("geometry"); m_showAnimation->setTargetObject(this); m_hideAnimation->setPropertyName("geometry"); m_hideAnimation->setTargetObject(this); this->setFixedSize(USER_ICON_SIZE,USER_ICON_SIZE); QRect desktopRect = qApp->desktop()->availableGeometry(); m_finalX = (desktopRect.width()- USER_ICON_SIZE)/2; m_finalY = (desktopRect.height()- USER_ICON_SIZE)/2 - 150; this->move(m_finalX, m_finalY); addUser(QString(":img/user/kakaxi.png"), "administrator"); // addUser(QString(":img/mingren.png"), "demo"); // addUser(QString(":img/mingren.png"), "test"); // addUser(QString(":img/mingren.png"), "tom"); // addUser(QString(":img/mingren.png"), "linda"); setLayout(m_Layout); setStyleSheet("background-color: #66CDAA"); QList<ImageButton*> m_children = this->findChildren<ImageButton *>(); for(int i = 0; i < m_children.length(); i++) { if (m_children[i]->objectName() != m_currentUser) { m_children[i]->hide(); } else { m_children[i]->setIconSize(ImageButton::AvatarSmallSize); } } showWidget(); initConnect(); }
void TransferView::streamFinished( StreamConnection* sc ) { if ( !m_index.contains( sc ) ) return; QPersistentModelIndex i = m_index.take( sc ); delete m_tree->invisibleRootItem()->takeChild( i.row() ); if ( m_tree->invisibleRootItem()->childCount() > 0 ) emit showWidget(); else emit hideWidget(); /* if ( m_index.contains( sc ) ) { int i = m_index.value( sc ); m_tree->invisibleRootItem()->child( i )->setText( 1, tr( "Finished" ) ); }*/ }
void MainWindow::onLogonSuccess() { hideWaitingWidget(); // we are: logged on | changed status to online | reconnected after network failure LOGONPROVIDER->saveStatus(UserStatus::Online); // TODO need it only for logged on | changed status to online if (!INFOMANAGER->getIsLoggedOn()) { init(); updateWindowTitle(); buttonsFrame->show(); showWidget(TV); } start(); INFOMANAGER->setStatus(UserStatus::Online); isLoggingOn = false; }
void XListBox::mouseWheelUp(X_Event *event) { compute(6); onPaint(X_UPDATE); showWidget(); }
AppMainWindow::AppMainWindow( SPage *page , QWidget *parent ) : QWidget( parent ) { p = new AppMainWindowPrivate; p->page = page; p->statusbar = 0; p->toolbar = 0; const SAboutData & about = p->page->parentApp()->parent(); p->win_id = about.name() + "_" + about.version() + "_" + p->page->title(); p->win_id.remove("=").remove(" "); /*! --------- Recover last Size of the window ------------- */ QString type_str = Silicon::readConf( PAGE_HEAD_CONF , p->win_id ); if( type_str.contains(",") ) { const QStringList & list = type_str.split(","); if( list.count() == 2 ) resize( list.first().toInt() , list.last().toInt() ); } else resize( p->page->size() ); /*! ------------------------------------------------------ */ p->switch_type_action = new QAction( SMasterIcons::icon(QSize(48,48) , "window-duplicate.png") , tr("Switch page type") , this ); p->switch_type_action->setShortcut( QKeySequence( Qt::CTRL + Qt::Key_W ) ); p->switch_type_action->setEnabled( p->page->menuPanel()->isEnabled() ); p->close_action = new QAction( SMasterIcons::icon(QSize(48,48) , "window-close.png") , tr("Close Page") , this ); p->close_action->setShortcut( QKeySequence( Qt::CTRL + Qt::Key_Q ) ); addAction( p->switch_type_action ); addAction( p->close_action ); p->toolbar_layout = new QHBoxLayout(); p->toolbar_layout->setContentsMargins( 0 , 0 , 0 , 0 ); p->layout = new QVBoxLayout( this ); p->layout->addLayout( p->toolbar_layout ); p->layout->addWidget( p->page ); p->layout->setContentsMargins( 1 , 1 , 1 , 1 ); p->layout->setSpacing( 1 ); setWindowFlags( Qt::Dialog ); setMouseTracking( true ); p->menu = new SContextButton(); p->menu->setIcon( SMasterIcons::icon( QSize(48,48) , "configure.png" ) ); p->menu->setFlat( true ); p->menu->setIconSize( MENU_ICON_SIZE ); p->menu->addItem( p->switch_type_action ); p->menu->addItem( p->close_action ); p->hide_widget = new SAutoHideWidget( this ); p->hide_widget->setWidget( p->menu ); p->hide_widget->setFixedSize( MENU_SIZE ); p->hide_widget->setHiddenTimer( 1500 ); connect( p->page->menuPanel() , SIGNAL(updated()) , this , SLOT(updated()) ); connect( p->page , SIGNAL(resized(QSize)) , this , SLOT(resizeSlot(QSize)) , Qt::QueuedConnection ); connect( p->switch_type_action , SIGNAL(triggered()) , p->page , SLOT(switchPageType()) , Qt::QueuedConnection ); connect( p->close_action , SIGNAL(triggered()) , p->page , SLOT(close()) , Qt::QueuedConnection ) ; refresh(); updated(); QTimer::singleShot( 123 , p->hide_widget , SLOT(showWidget()) ); }
void MainWindow::showTvWidget() { showWidget(TV); }
MainWidget::MainWidget(QWidget *parent) : DropShadowWidget(parent) { initLocalConnection(); setMinimumSize(900, 600); setWindowIcon(QIcon(":/img/safe")); statked_widget = new QStackedWidget(); title_widget = new TitleWidget(); content_widget = new ContentWidget(); kill_mummy_widget = new KillMummyWidget(); main_menu = new MainMenu(); character_widget = new CharacterWidget(); about_us_dialog = new AboutUsDialog(this); setting_dialog = new SettingDialog(this); login_dialog = new LoginDialog(this); register_widget = new RegisterWidget(this); skin_widget = new SkinWidget(this); system_tray = new SystemTray(this); QPalette palette; palette.setBrush(QPalette::Window, QBrush(Qt::white)); statked_widget->setPalette(palette); statked_widget->setAutoFillBackground(true); statked_widget->addWidget(content_widget); statked_widget->addWidget(kill_mummy_widget); QVBoxLayout *center_layout = new QVBoxLayout(); center_layout->addWidget(statked_widget); center_layout->setSpacing(0); center_layout->setContentsMargins(0, 0, 0, 0); QVBoxLayout *main_layout = new QVBoxLayout(); main_layout->addWidget(title_widget); main_layout->addLayout(center_layout); main_layout->setSpacing(0); main_layout->setContentsMargins(SHADOW_WIDTH, SHADOW_WIDTH, SHADOW_WIDTH, SHADOW_WIDTH); setLayout(main_layout); connect(title_widget, SIGNAL(showSkin()), this, SLOT(showSkinWidget())); connect(title_widget, SIGNAL(showMainMenu()), this, SLOT(showMainMenu())); connect(title_widget, SIGNAL(showMin()), this, SLOT(showMinimized())); connect(title_widget, SIGNAL(closeWidget()), this, SLOT(hide())); connect(title_widget, SIGNAL(turnPage(int)), this, SLOT(turnPage(int))); connect(main_menu, SIGNAL(showSettingDialog()), this, SLOT(showSettingDialog())); connect(main_menu, SIGNAL(showNewCharacter()), this, SLOT(showNewCharacter())); connect(main_menu, SIGNAL(showAboutUs()), this, SLOT(showAboutUs())); connect(content_widget, SIGNAL(showLoginDialog()), this, SLOT(showLoginDialog())); connect(content_widget, SIGNAL(showRegisterDialog()), this, SLOT(showRegisterDialog())); connect(setting_dialog, SIGNAL(changeLanguage(LANGUAGE)), this, SLOT(changeLanguage(LANGUAGE))); connect(skin_widget, SIGNAL(changeSkin(QString)), this, SLOT(changeSkin(QString))); connect(system_tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconIsActived(QSystemTrayIcon::ActivationReason))); connect(system_tray, SIGNAL(showWidget()), this, SLOT(showWidget())); system_tray->show(); title_widget->turnPage("0"); skin_name = Util::getSkinName(); if( QString::compare(skin_name, QString("")) == 0) { this->changeSkin(DEFAULT_SKIN); } }
void MainWindow::showLogonWidget(bool updateFields) { logonWidget->prepareToShow(updateFields); showWidget(Logon); }
void MainWindow::showWaitingWidget() { widgetIndexBeforeWaiting = stackedWidget->currentIndex(); showWidget(Waiting); waitingWidget->startWaitingTimer(); }
void XWidget::reLayout() { computeLayout(); onPaint(X_PAINT); showWidget(); }
void MainWindow::showInviteCodeWidget() { showWidget(Invite); }
void CController::initWidgets() { insertWidgets(); hideAllWidgets(); showWidget(s_sigLoginWidget); }
void MainWindow::showRegistrationWidget() { showWidget(Registration); }
void MainWindow::showForgotPasswordWidget() { forgotPasswordWidget->setLoginField(logonWidget->loginCombo->lineEdit()->text()); showWidget(ForgotPassword); }
/////////////////////////////////////////////////////////////////////////////////////////// // // CS : PUBLIC void initUI(gchar *pWindowTitle, ST_PrinterStatus *pPrinterStatus, gboolean isPrinting, ENUM_OtherMessageID otherMsg) // IN : gchar *pWindowTitle : Window title string. // ST_PrinterStatus *pPrinterStatus : Information of printer status. // gboolean isPrinting : TRUE : Printing. // FALSE : Not printing. // ENUM_OtherMessageID otherMsg : Message ID except printer status message. // OUT : None. // RETURN : None. // PUBLIC void initUI(gchar *pWindowTitle, ST_PrinterStatus *pPrinterStatus, gboolean isPrinting, ENUM_OtherMessageID otherMsg) { #ifdef USE_libglade /*** Parameters start ***/ gchar gladeFileName[MAX_BUF_SIZE]; // Buffer for glade file name. ENUM_STSMessageID *pMessageID; // Pointer to array of message ID. gint i; // Counter. /*** Parameters end ***/ // Create full path of glade file name. memset (gladeFileName, 0, MAX_BUF_SIZE); strncpy(gladeFileName, STR_SHARE_DIRECTORY_NAME, (MAX_BUF_SIZE<(strlen(STR_SHARE_DIRECTORY_NAME)+strlen(GLADE_FILE_NAME)+1))? MAX_BUF_SIZE<(strlen(STR_SHARE_DIRECTORY_NAME)+strlen(GLADE_FILE_NAME)+1)); strcat(gladeFileName, "/"); strcat(gladeFileName, GLADE_FILE_NAME); // Show window. gXmlMainWnd = glade_xml_new(gladeFileName, STR_WINDOW_NAME_MAIN); // Set window title. setWindowTitle(STR_WINDOW_NAME_MAIN, pWindowTitle); // Initialize related cartridge area drawing handling. initDrawing(); // Disable [Cancel Printing] button. activateWidget(STR_MAIN_BUTTON_NAME_CANCEL, FALSE); if (isPrinting == FALSE) { // Not printing. // Initialize UI settings. (Without printer status.) updateUISettings(NULL, otherMsg, TRUE, TRUE, TRUE, TRUE); } else { // Printing. // Enable [Cancel Printing] button. if (pPrinterStatus->printInterface == ID_DEV_1284 ) activateWidget(STR_MAIN_BUTTON_NAME_CANCEL, TRUE); // Check messages. pMessageID = pPrinterStatus->pMessageID; for (i = 0; i < pPrinterStatus->messageNum; i++) { if (*pMessageID == ID_STS_MESSAGE_CARTRIDGE_UNSUPPORTED || *pMessageID == ID_STS_MESSAGE_OC_PAPER_OUT21 // ver.2.5 || *pMessageID == ID_STS_MESSAGE_OC_PAPER_OUT22 // ver.2.5 || *pMssageID == ID_STS_MESSAGE_OC_PAPER_JAM || *pMssageID == ID_STS_MESSAGE_OC_PAPER_JAM03 // ver.2.5 || *pMssageID == ID_STS_MESSAGE_OC_PAPER_JAM04 // ver.2.5 || *pMessageID == ID_STS_MESSAGE_OC_USBDEVICE // Ver.2.4 || *pMessageID == ID_STS_MESSAGE_OC_HEADALIGNMENT // Ver.2.4 ) { // Disable [Cancel Printing] button. activateWidget(STR_MAIN_BUTTON_NAME_CANCEL, FALSE); break; } pMessageID++; } // Initialize UI settings related with printer status. updateUISettings(pPrinterStatus, ID_OTHER_MESSAGE_NONE, TRUE, TRUE, TRUE, TRUE); } // Hide [Continue] button. showWidget(STR_MAIN_BUTTON_NAME_CONTINUE, FALSE); //for Ver.2.70 showWidget(STR_MAIN_BUTTON_NAME_CANCEL, FALSE); // Signal connect. glade_xml_signal_autoconnect(gXmlMainWnd); return; #else // use Gtk+-1.2 /*** Parameters start ***/ ENUM_STSMessageID *pMessageID; // Pointer to array of message ID. gint i; // Counter. // struct sigaction sa; /*** Parameters end ***/ // Show window. gMainWnd = create_mainWindow(); // Initialize related cartridge area drawing handling. initDrawing(); // Set window title. setWindowTitle(STR_WINDOW_NAME_MAIN, pWindowTitle); // Disable [Cancel Printing] button. activateWidget(STR_MAIN_BUTTON_NAME_CANCEL, FALSE); if (isPrinting == FALSE) { // Not printing. // Initialize UI settings. (Without printer status.) updateUISettings(NULL, otherMsg, TRUE, TRUE, TRUE, TRUE); } else { // Printing. // Enable [Cancel Printing] button. if (pPrinterStatus->printInterface == ID_DEV_1284 ) activateWidget(STR_MAIN_BUTTON_NAME_CANCEL, TRUE); // Check messages. pMessageID = pPrinterStatus->pMessageID; for (i = 0; i < pPrinterStatus->messageNum; i++) { if (*pMessageID == ID_STS_MESSAGE_CARTRIDGE_UNSUPPORTED || *pMessageID == ID_STS_MESSAGE_OC_PAPER_OUT21 // ver.2.5 || *pMessageID == ID_STS_MESSAGE_OC_PAPER_OUT22 // ver.2.5 || *pMessageID == ID_STS_MESSAGE_OC_PAPER_JAM || *pMessageID == ID_STS_MESSAGE_OC_PAPER_JAM03 // ver.2.5 || *pMessageID == ID_STS_MESSAGE_OC_PAPER_JAM04 // ver.2.5 || *pMessageID == ID_STS_MESSAGE_OC_USBDEVICE // Ver.2.4 || *pMessageID == ID_STS_MESSAGE_OC_HEADALIGNMENT // Ver.2.4 ) { // Disable [Cancel Printing] button. activateWidget(STR_MAIN_BUTTON_NAME_CANCEL, FALSE); break; } pMessageID++; } // Initialize UI settings related with printer status. updateUISettings(pPrinterStatus, ID_OTHER_MESSAGE_NONE, TRUE, TRUE, TRUE, TRUE); } // Hide [Continue] button. showWidget(STR_MAIN_BUTTON_NAME_CONTINUE, FALSE); //for Ver.2.70 showWidget(STR_MAIN_BUTTON_NAME_CANCEL, FALSE); // Show showWidget(STR_WINDOW_NAME_MAIN, TRUE); // Signal connect. // memset( &sa, 0, sizeof(sa)); // sa.sa_handler = sighand_term; // if( sigaction( SIGTERM, &sa, NULL) ) perror("sigaction"); return; #endif // USE_libglade }// End initUI
void MainWindow::showInfoWidget() { showWidget(Info); }