void TitleWidget::initUi(const bool &isMainTitle) { QLabel *logoLabel = new QLabel; QPixmap pix(":/title_images/logo"); QSize s(25, 25); // 将图标缩小 logoLabel->setPixmap(pix.scaled(s, Qt::KeepAspectRatio)); QLabel *titleLabel = new QLabel(APP_NAME + " " + APP_VERSION); titleLabel->setObjectName("TitleLabel"); ImageButton *upButton = new ImageButton(":/title_images/update_btn"); upButton->setCursorEnable(true); connect(upButton, SIGNAL(clicked()), this, SIGNAL(updateClicked())); QWidget *titleWidget = new QWidget(this); QHBoxLayout *titleLayout = new QHBoxLayout(titleWidget); titleLayout->addWidget(logoLabel, 0, Qt::AlignVCenter); titleLayout->addWidget(titleLabel, 0, Qt::AlignVCenter); titleLayout->addWidget(upButton, 0, Qt::AlignVCenter); titleLayout->setContentsMargins(0, 0, 0, 0); ImageButton *closeButton = new ImageButton(":/title_images/close_btn"); closeButton->setCursorEnable(true); connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeClicked())); QWidget *buttonWidget = new QWidget; QHBoxLayout *buttnLayout = new QHBoxLayout(buttonWidget); if (isMainTitle) { ImageButton *miniButton = new ImageButton(":/title_images/mini_btn"); miniButton->setCursorEnable(true); connect(miniButton, SIGNAL(clicked()), this, SIGNAL(showMini())); ImageButton *menuButton = new ImageButton(":/title_images/menu_btn"); menuButton->setCursorEnable(true); //connect(menuButton, SIGNAL(clicked()), this, SIGNAL(showMenu())); connect(menuButton, SIGNAL(clicked()), this, SLOT(menuVisiable())); ImageButton *skinButton = new ImageButton(":/title_images/skin_btn"); skinButton->setCursorEnable(true); connect(skinButton, SIGNAL(clicked()), this, SIGNAL(showSkin())); buttnLayout->addWidget(skinButton, 0, Qt::AlignVCenter); buttnLayout->addWidget(miniButton, 0, Qt::AlignVCenter); buttnLayout->addWidget(menuButton, 0, Qt::AlignVCenter); } buttnLayout->addWidget(closeButton, 0, Qt::AlignVCenter); buttnLayout->setContentsMargins(0, 0, 0, 0); QHBoxLayout *mainLayout = new QHBoxLayout(this); mainLayout->addWidget(titleWidget, 0, Qt::AlignLeft | Qt::AlignTop); mainLayout->addStretch(); mainLayout->addWidget(buttonWidget, 0, Qt::AlignRight | Qt::AlignVCenter); mainLayout->setContentsMargins(5, 5, 5, 5); }
ConfigGui::ConfigGui(QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f) , defaultConfigDir(QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation)) , httpRequestAborted(false) , reply(NULL) , file(NULL) { setupUi(this); manager = new QNetworkAccessManager(this); QObject::connect(fileRadioButton, SIGNAL(clicked()), this, SLOT(configSourceRadioButtonClicked())); QObject::connect(URLRadioButton, SIGNAL(clicked()), this, SLOT(configSourceRadioButtonClicked())); QObject::connect(browsePushButton, SIGNAL(clicked()), this, SLOT(browseFileClicked())); QObject::connect(URLLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(URLChanged(const QString&))); QObject::connect(updateButton, SIGNAL(clicked()), this, SLOT(updateClicked())); QPushButton* applyButton = buttonBox->button(QDialogButtonBox::Apply); QObject::connect(applyButton, SIGNAL(clicked()), this, SLOT(apply())); QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(hide())); settings.beginGroup("DbPassGui"); QString usernames = settings.value("usernames").toString(); usernamesTextEdit->setPlainText(usernames.split(',').join("\r\n")); configFilePath = settings.value("filepath").toString(); configURLPath = settings.value("urlpath").toString(); settings.endGroup(); QFileInfo file(configFilePath); if (file.isReadable()) fileLineEdit->setText(configFilePath); QUrl url(configURLPath); if (url.isValid()) URLLineEdit->setText(configURLPath); fileRadioButton->setChecked(!url.isValid()); fileLineEdit->setEnabled(!url.isValid()); browsePushButton->setEnabled(!url.isValid()); URLRadioButton->setChecked(url.isValid()); URLLineEdit->setEnabled(url.isValid()); updateButton->setEnabled(url.isValid()); }
bool LogViewer::Create(void) { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("mytharchive-ui.xml", "logviewer", this); if (!foundtheme) return false; bool err = false; UIUtilE::Assign(this, m_logList, "loglist", &err); UIUtilE::Assign(this, m_logText, "logitem_text", &err); UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err); UIUtilE::Assign(this, m_updateButton, "update_button", &err); UIUtilE::Assign(this, m_exitButton, "exit_button", &err); if (err) { VERBOSE(VB_IMPORTANT, "Cannot load screen 'logviewer'"); return false; } connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelClicked())); connect(m_updateButton, SIGNAL(Clicked()), this, SLOT(updateClicked())); connect(m_exitButton, SIGNAL(Clicked()), this, SLOT(Close())); connect(m_logList, SIGNAL(itemSelected(MythUIButtonListItem*)), this, SLOT(updateLogItem(MythUIButtonListItem*))); m_updateTimer = NULL; m_updateTimer = new QTimer(this); connect(m_updateTimer, SIGNAL(timeout()), SLOT(updateTimerTimeout()) ); BuildFocusList(); SetFocusWidget(m_logList); return true; }
void LogViewer::Init(void) { updateClicked(); if (m_logList->GetCount() > 0) m_logList->SetItemCurrent(m_logList->GetCount() - 1); }
void LogViewer::showFullLog(void) { m_currentLog = m_fullLog; m_logList->Reset(); updateClicked(); }
void LogViewer::showProgressLog(void) { m_currentLog = m_progressLog; m_logList->Reset(); updateClicked(); }
void LogViewer::updateTimerTimeout() { updateClicked(); }
KoCsvImportDialog::KoCsvImportDialog(QWidget* parent) : KDialog(parent) , d(new Private(this)) { d->dialog = new KoCsvImportWidget(this); d->rowsAdjusted = false; d->columnsAdjusted = false; d->startRow = 0; d->startCol = 0; d->endRow = -1; d->endCol = -1; d->textQuote = QChar('"'); d->delimiter = QString(','); d->ignoreDuplicates = false; d->codec = QTextCodec::codecForName("UTF-8"); setButtons( KDialog::Ok|KDialog::Cancel ); setCaption( i18n( "Import Data" ) ); QStringList encodings; encodings << i18nc( "Descriptive encoding name", "Recommended ( %1 )" ,"UTF-8" ); encodings << i18nc( "Descriptive encoding name", "Locale ( %1 )" ,QString(QTextCodec::codecForLocale()->name() )); encodings += KGlobal::charsets()->descriptiveEncodingNames(); // Add a few non-standard encodings, which might be useful for text files const QString description(i18nc("Descriptive encoding name","Other ( %1 )")); encodings << description.arg("Apple Roman"); // Apple encodings << description.arg("IBM 850") << description.arg("IBM 866"); // MS DOS encodings << description.arg("CP 1258"); // Windows d->dialog->comboBoxEncoding->insertItems( 0, encodings ); setDataTypes(Generic|Text|Date|None); // XXX: Qt3->Q4 //d->dialog->m_sheet->setReadOnly( true ); d->loadSettings(); //resize(sizeHint()); resize( 600, 400 ); // Try to show as much as possible of the table view setMainWidget(d->dialog); d->dialog->m_sheet->setSelectionMode( QAbstractItemView::MultiSelection ); QButtonGroup* buttonGroup = new QButtonGroup( this ); buttonGroup->addButton(d->dialog->m_radioComma, 0); buttonGroup->addButton(d->dialog->m_radioSemicolon, 1); buttonGroup->addButton(d->dialog->m_radioSpace, 2); buttonGroup->addButton(d->dialog->m_radioTab, 3); buttonGroup->addButton(d->dialog->m_radioOther, 4); connect(d->dialog->m_formatComboBox, SIGNAL(activated( const QString& )), this, SLOT(formatChanged( const QString& ))); connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(delimiterClicked(int))); connect(d->dialog->m_delimiterEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed())); connect(d->dialog->m_delimiterEdit, SIGNAL(textChanged ( const QString & )), this, SLOT(genericDelimiterChanged( const QString & ) )); connect(d->dialog->m_comboQuote, SIGNAL(activated(const QString &)), this, SLOT(textquoteSelected(const QString &))); connect(d->dialog->m_sheet, SIGNAL(currentCellChanged(int, int, int, int)), this, SLOT(currentCellChanged(int, int))); connect(d->dialog->m_ignoreDuplicates, SIGNAL(stateChanged(int)), this, SLOT(ignoreDuplicatesChanged(int))); connect(d->dialog->m_updateButton, SIGNAL(clicked()), this, SLOT(updateClicked())); connect(d->dialog->comboBoxEncoding, SIGNAL(textChanged ( const QString & )), this, SLOT(encodingChanged ( const QString & ) )); }
void BitcoinGUI::createActions(const NetworkStyle *networkStyle) { tabGroup = new QActionGroup(this); overviewAction = new QAction(QIcon(":/icons/overview"), tr("&Dashboard"), this); overviewAction->setStatusTip(tr("Show general overview of wallet")); overviewAction->setToolTip(overviewAction->statusTip()); overviewAction->setCheckable(true); #ifdef Q_OS_MAC overviewAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_1)); #else overviewAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_1)); #endif tabGroup->addAction(overviewAction); sendCoinsAction = new QAction(QIcon(":/icons/send"), tr("&Send"), this); sendCoinsAction->setStatusTip(tr("Send coins to a Crown address")); sendCoinsAction->setToolTip(sendCoinsAction->statusTip()); sendCoinsAction->setCheckable(true); #ifdef Q_OS_MAC sendCoinsAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_2)); #else sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2)); #endif tabGroup->addAction(sendCoinsAction); receiveCoinsAction = new QAction(QIcon(":/icons/receiving_addresses"), tr("&Receive"), this); receiveCoinsAction->setStatusTip(tr("Request payments (generates QR codes and crown: URIs)")); receiveCoinsAction->setToolTip(receiveCoinsAction->statusTip()); receiveCoinsAction->setCheckable(true); #ifdef Q_OS_MAC receiveCoinsAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_3)); #else receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_3)); #endif tabGroup->addAction(receiveCoinsAction); historyAction = new QAction(QIcon(":/icons/history"), tr("&Transactions"), this); historyAction->setStatusTip(tr("Browse transaction history")); historyAction->setToolTip(historyAction->statusTip()); historyAction->setCheckable(true); #ifdef Q_OS_MAC historyAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_4)); #else historyAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_4)); #endif tabGroup->addAction(historyAction); #ifdef Q_OS_MAC receiveCoinsAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_5)); #else receiveCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_5)); #endif multisigAction = new QAction(QIcon(":/icons/send"), tr("Multisig"), this); tabGroup->addAction(multisigAction); #ifdef ENABLE_WALLET // These showNormalIfMinimized are needed because Send Coins and Receive Coins // can be triggered from the tray menu, and need to show the GUI to be useful. connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); connect(multisigAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(multisigAction, SIGNAL(triggered()), this, SLOT(gotoMultisigTab())); #endif // ENABLE_WALLET quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); quitAction->setStatusTip(tr("Quit application")); quitAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q)); quitAction->setMenuRole(QAction::QuitRole); aboutAction = new QAction(networkStyle->getAppIcon(), tr("&About Crown Core"), this); aboutAction->setStatusTip(tr("Show information about Crown Core")); aboutAction->setMenuRole(QAction::AboutRole); updateAction = new QAction(QIcon(":/icons/notsynced"), tr("&Check for Updates"), this); updateAction->setStatusTip(tr("Check for availalbe updates")); #if QT_VERSION < 0x050000 aboutQtAction = new QAction(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); #else aboutQtAction = new QAction(QIcon(":/qt-project.org/qmessagebox/images/qtlogo-64.png"), tr("About &Qt"), this); #endif aboutQtAction->setStatusTip(tr("Show information about Qt")); aboutQtAction->setMenuRole(QAction::AboutQtRole); optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this); optionsAction->setStatusTip(tr("Modify configuration options for Crown")); optionsAction->setMenuRole(QAction::PreferencesRole); toggleHideAction = new QAction(networkStyle->getAppIcon(), tr("&Show / Hide"), this); toggleHideAction->setStatusTip(tr("Show or hide the main Window")); encryptWalletAction = new QAction(QIcon(":/icons/lock_closed"), tr("&Encrypt Wallet..."), this); encryptWalletAction->setStatusTip(tr("Encrypt the private keys that belong to your wallet")); encryptWalletAction->setCheckable(true); backupWalletAction = new QAction(QIcon(":/icons/filesave"), tr("&Backup Wallet..."), this); backupWalletAction->setStatusTip(tr("Backup wallet to another location")); changePassphraseAction = new QAction(QIcon(":/icons/key"), tr("&Change Passphrase..."), this); changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption")); unlockWalletAction = new QAction(tr("&Unlock Wallet..."), this); unlockWalletAction->setToolTip(tr("Unlock wallet")); lockWalletAction = new QAction(tr("&Lock Wallet"), this); signMessageAction = new QAction(QIcon(":/icons/edit"), tr("Sign &message..."), this); signMessageAction->setStatusTip(tr("Sign messages with your Crown addresses to prove you own them")); verifyMessageAction = new QAction(QIcon(":/icons/transaction_0"), tr("&Verify message..."), this); verifyMessageAction->setStatusTip(tr("Verify messages to ensure they were signed with specified Crown addresses")); openInfoAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Information"), this); openInfoAction->setStatusTip(tr("Show diagnostic information")); openRPCConsoleAction = new QAction(QIcon(":/icons/debugwindow"), tr("&Debug console"), this); openRPCConsoleAction->setStatusTip(tr("Open debugging console")); openNetworkAction = new QAction(QIcon(":/icons/connect_4"), tr("&Network Monitor"), this); openNetworkAction->setStatusTip(tr("Show network monitor")); openPeersAction = new QAction(QIcon(":/icons/connect_4"), tr("&Peers list"), this); openPeersAction->setStatusTip(tr("Show peers info")); openRepairAction = new QAction(QIcon(":/icons/options"), tr("Wallet &Repair"), this); openRepairAction->setStatusTip(tr("Show wallet repair options")); openConfEditorAction = new QAction(QIcon(":/icons/edit"), tr("Open &Configuration File"), this); openConfEditorAction->setStatusTip(tr("Open configuration file")); showBackupsAction = new QAction(QIcon(":/icons/browse"), tr("Show Automatic &Backups"), this); showBackupsAction->setStatusTip(tr("Show automatically created wallet backups")); usedSendingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Sending addresses..."), this); usedSendingAddressesAction->setStatusTip(tr("Show the list of used sending addresses and labels")); usedReceivingAddressesAction = new QAction(QIcon(":/icons/address-book"), tr("&Receiving addresses..."), this); usedReceivingAddressesAction->setStatusTip(tr("Show the list of used receiving addresses and labels")); openAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_FileIcon), tr("Open &URI..."), this); openAction->setStatusTip(tr("Open a crown: URI or payment request")); showHelpMessageAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation), tr("&Command-line options"), this); showHelpMessageAction->setMenuRole(QAction::NoRole); showHelpMessageAction->setStatusTip(tr("Show the Crown Core help message to get a list with possible Crown command-line options")); connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(updateAction, SIGNAL(triggered()), this, SLOT(updateClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(toggleHideAction, SIGNAL(triggered()), this, SLOT(toggleHidden())); connect(showHelpMessageAction, SIGNAL(triggered()), this, SLOT(showHelpMessageClicked())); #ifdef ENABLE_WALLET if(walletFrame) { connect(encryptWalletAction, SIGNAL(triggered(bool)), walletFrame, SLOT(encryptWallet(bool))); connect(backupWalletAction, SIGNAL(triggered()), walletFrame, SLOT(backupWallet())); connect(changePassphraseAction, SIGNAL(triggered()), walletFrame, SLOT(changePassphrase())); connect(unlockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(unlockWallet())); connect(lockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(lockWallet())); connect(signMessageAction, SIGNAL(triggered()), this, SLOT(gotoSignMessageTab())); connect(verifyMessageAction, SIGNAL(triggered()), this, SLOT(gotoVerifyMessageTab())); connect(usedSendingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedSendingAddresses())); connect(usedReceivingAddressesAction, SIGNAL(triggered()), walletFrame, SLOT(usedReceivingAddresses())); connect(openAction, SIGNAL(triggered()), this, SLOT(openClicked())); } #endif // ENABLE_WALLET }
//------------------------------------------------------------- QGroupBox *ConeGeometry::createInfoBox() { infoBox = new QGroupBox; infoBox->setTitle(tr("Cone details")); infoBox->setObjectName(tr("infoBox")); QLabel *center1 = new QLabel(tr("Centre 1")); QLabel *center2 = new QLabel(tr("Centre 2")); QLabel *r0 = new QLabel(tr("r:")); QLabel *r1 = new QLabel(tr("r:")); QLabel *x0 = new QLabel(tr("x:")); QLabel *x1 = new QLabel(tr("x:")); QLabel *y0 = new QLabel(tr("y:")); QLabel *y1 = new QLabel(tr("y:")); QLabel *z0 = new QLabel(tr("z:")); QLabel *z1 = new QLabel(tr("z:")); pointEdit0 = new QLineEdit(infoBox); pointEdit1 = new QLineEdit(infoBox); pointEdit2 = new QLineEdit(infoBox); pointEdit3 = new QLineEdit(infoBox); pointEdit4 = new QLineEdit(infoBox); pointEdit5 = new QLineEdit(infoBox); radiusEdit0 = new QLineEdit(infoBox); radiusEdit1 = new QLineEdit(infoBox); pointEdit0->setObjectName("pointEdit0"); pointEdit1->setObjectName("pointEdit1"); pointEdit2->setObjectName("pointEdit2"); pointEdit3->setObjectName("pointEdit3"); pointEdit4->setObjectName("pointEdit4"); pointEdit5->setObjectName("pointEdit5"); radiusEdit0->setObjectName("radiusEdit0"); radiusEdit1->setObjectName("radiusEdit1"); x0->setBuddy(pointEdit0); y0->setBuddy(pointEdit1); z0->setBuddy(pointEdit2); x1->setBuddy(pointEdit3); y1->setBuddy(pointEdit4); z1->setBuddy(pointEdit5); r0->setBuddy(radiusEdit0); r1->setBuddy(radiusEdit1); QBoxLayout *topInfoLayout = new QVBoxLayout(); QBoxLayout *bottomInfoLayout = new QVBoxLayout(); topInfoLayout->addWidget(center1); topInfoLayout->addWidget(x0); topInfoLayout->addWidget(pointEdit0); topInfoLayout->addWidget(y0); topInfoLayout->addWidget(pointEdit1); topInfoLayout->addWidget(z0); topInfoLayout->addWidget(pointEdit2); topInfoLayout->addWidget(r0); topInfoLayout->addWidget(radiusEdit0); bottomInfoLayout->addWidget(center2); bottomInfoLayout->addWidget(x1); bottomInfoLayout->addWidget(pointEdit3); bottomInfoLayout->addWidget(y1); bottomInfoLayout->addWidget(pointEdit4); bottomInfoLayout->addWidget(z1); bottomInfoLayout->addWidget(pointEdit5); bottomInfoLayout->addWidget(r1); bottomInfoLayout->addWidget(radiusEdit1); QBoxLayout *coneInfoLayout = new QHBoxLayout(); coneInfoLayout->addLayout(topInfoLayout); coneInfoLayout->addLayout(bottomInfoLayout); QPushButton *updateButton = new QPushButton(tr("Update")); connect(updateButton, SIGNAL(clicked()), this, SLOT(updateClicked())); coneInfoLayout->addWidget(updateButton); infoBox->setLayout(coneInfoLayout); infoBox->setMaximumSize(QSize(200,250)); return infoBox; }