KateSaveModifiedDialog::KateSaveModifiedDialog(QWidget *parent, QList<KTextEditor::Document*> documents):
    KDialog( parent)
{

  setCaption( i18n("Save Documents") );
  setButtons( KDialog::User1 | KDialog::No | Cancel );
  setObjectName( "KateSaveModifiedDialog" );
  setModal( true );

  setButtonGuiItem(KDialog::User1, KStandardGuiItem::save());
  connect(this, SIGNAL(user1Clicked()), this, SLOT(slotSaveSelected()));

  setButtonGuiItem(KDialog::No, KStandardGuiItem::discard());
  connect(this, SIGNAL(noClicked()), this, SLOT(slotDoNotSave()));

  setButtonGuiItem(KDialog::Cancel, KStandardGuiItem::cancel());
  setDefaultButton(KDialog::Cancel);
  setButtonFocus(KDialog::Cancel);

  KVBox *box = new KVBox(this);
  setMainWidget(box);
  new QLabel(i18n("<qt>The following documents have been modified. Do you want to save them before closing?</qt>"), box);
  m_list = new QTreeWidget(box);
  m_list->setColumnCount(2);
  m_list->setHeaderLabels(QStringList() << i18n("Documents") << i18n("Location"));
  m_list->setRootIsDecorated(true);

  foreach (KTextEditor::Document* doc, documents) {
    m_list->addTopLevelItem(new KateSaveModifiedDocumentCheckListItem(doc));
  }
Пример #2
0
RecordConfirmationDialog::RecordConfirmationDialog(const QString &sn, const QString &displayName) :
	IconDialogBase(tr("Recording confirmation"), QStyle::SP_MessageBoxQuestion),
	skypeName(sn)
{
	QLabel *label = new QLabel(tr("%1 has started recording the call with <b>%2</b> (%3).<br>"
		"Do you wish to continue recording or shall it stop and delete the file?").arg(PROGRAM_NAME, skypeName, displayName));
	vbox->addWidget(label);

	vbox->addSpacing(10);

	remember = new QCheckBox(tr("&Automatically perform this action on the next call with %1").arg(skypeName));
	remember->setEnabled(false);
	widgets.append(remember);
	vbox->addWidget(remember);

	hbox->addStretch(1);

	QPushButton *button = new QPushButton(tr("&Continue recording"));
	button->setEnabled(false);
	button->setDefault(true);
	button->setMinimumWidth(180);
	widgets.append(button);
	connect(button, SIGNAL(clicked()), this, SLOT(yesClicked()));
	hbox->addWidget(button);

	button = new QPushButton(tr("&Stop recording and delete"));
	button->setEnabled(false);
	button->setMinimumWidth(180);
	widgets.append(button);
	connect(button, SIGNAL(clicked()), this, SLOT(noClicked()));
	hbox->addWidget(button);

	hbox->addStretch(1);

	connect(this, SIGNAL(rejected()), this, SIGNAL(no()));
	QTimer::singleShot(1000, this, SLOT(enableWidgets()));

	show();
	raise();
	activateWindow();
}
Пример #3
0
int SMEngine::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: showMe(); break;
        case 1: setLabel((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 2: setWidget((*reinterpret_cast< QWidget*(*)>(_a[1]))); break;
        case 3: setLayout((*reinterpret_cast< QLayout*(*)>(_a[1]))); break;
        case 4: breakIsOver(); break;
        case 5: yesClicked(); break;
        case 6: noClicked(); break;
        case 7: confirnClicked(); break;
        case 8: skipClicked(); break;
        case 9: createGuiWithList((*reinterpret_cast< QList<QMap<QString,QString> >*(*)>(_a[1]))); break;
        case 10: createInputGuiWithDataSet((*reinterpret_cast< QMap<QString,QString>(*)>(_a[1]))); break;
        case 11: repaintGui(); break;
        case 12: changeWidget((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break;
        case 13: changeWidget((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 14: parseXMLFile((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 15: showInfoWidget((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 16: showInputWidget(); break;
        case 17: addLayout(); break;
        case 18: addWidgetToLayout((*reinterpret_cast< const QString(*)>(_a[1])),(*reinterpret_cast< const QString(*)>(_a[2]))); break;
        case 19: addWidgetToLayout((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 20: toggleFirstUse((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 21: finished(); break;
        case 22: executeSpec((*reinterpret_cast< QString(*)>(_a[1]))); break;
        case 23: acceptButton(); break;
        case 24: saveToDom((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
        case 25: timeOut(); break;
        case 26: emitClickSignal((*reinterpret_cast< int(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 27;
    }
    return _id;
}
bool BTRecvQueryDialogWidget::constructDialog(const QVariantMap &parameters)
{
    mLoader = new HbDocumentLoader();
    bool ok = false;
    
    mLoader->load(DOCML_BT_RECV_QUERY_DIALOG, &ok);
    if(ok)
    {
        mDialog = qobject_cast<HbDialog*>(mLoader->findWidget("receiveAuthorizationDialog"));
        mHeading = qobject_cast<HbLabel*>(mLoader->findWidget("receiveAuthorizationHeading"));
        
        mDeviceName = qobject_cast<HbLabel*>(mLoader->findWidget("deviceName"));
        mDeviceType = qobject_cast<HbLabel*>(mLoader->findWidget("deviceType"));
        mDeviceIcon = qobject_cast<HbLabel*>(mLoader->findWidget("deviceIcon"));
        
        int classOfDevice = parameters.value(QString::number(TBluetoothDeviceDialog::EDeviceClass)).toDouble();
        HbIcon icon = getBadgedDeviceTypeIcon(classOfDevice);
        mDeviceIcon->setIcon(icon);
                
        mDeviceName->setPlainText(parameters.value(QString::number(TBluetoothDeviceDialog::EDeviceName)).toString());
        mDeviceType->setPlainText(getDeviceTypeString(classOfDevice));
        
        mYesAction = qobject_cast<HbAction*>(mLoader->findObject("yesAction"));
        mNoAction = qobject_cast<HbAction*>(mLoader->findObject("noAction"));
        
        mAuthorizeUser = qobject_cast<HbCheckBox*>(mLoader->findWidget("authorizeUser"));

        int dialogType = parameters.value(QString::number(TBluetoothDialogParams::EDialogTitle)).toInt();
        switch(dialogType)
        {
            case TBluetoothDialogParams::EReceive:
            {
                mHeading->setPlainText(hbTrId("txt_bt_title_receive_messages_from"));
            }break;
                
            case TBluetoothDialogParams::EReceiveFromPairedDevice:
            {
                mHeading->setPlainText(hbTrId("txt_bt_title_receive_messages_from_paired_device"));
                mAuthorizeUser->setCheckState(Qt::Checked);
            }break;
            
            case TBluetoothDialogParams::EConnect:
            {
                mHeading->setPlainText(hbTrId("txt_bt_title_connect_to"));
                mAuthorizeUser->setCheckState(Qt::Checked);
            }break;
            case TBluetoothDialogParams::EPairingRequest:
                mHeading->setPlainText(hbTrId("txt_bt_title_pair_with"));
                mAuthorizeUser->setCheckState(Qt::Checked);                
                break;
            default:
                break;

        }
        mDialog->setHeadingWidget(mHeading);
    }

    mDialog->setBackgroundFaded(false);
    mDialog->setDismissPolicy(HbPopup::NoDismiss);
    mDialog->setTimeout(HbPopup::NoTimeout);
     
    connect(mYesAction, SIGNAL(triggered()), this, SLOT(yesClicked()));
    connect(mNoAction, SIGNAL(triggered()), this, SLOT(noClicked()));
    connect(mAuthorizeUser, SIGNAL(clicked(bool)), this, SLOT(checkBoxStateChanged(bool)));
    
    return true;
}