Пример #1
0
KomparePrefDlg::KomparePrefDlg( ViewSettings* viewSets, DiffSettings* diffSets ) : KPageDialog( 0 )
{
	setFaceType( KPageDialog::List );
	setWindowTitle( i18n( "Preferences" ) );
	setButtons( Help|Default|Ok|Apply|Cancel );
	setDefaultButton( Ok );
	setModal( true );
	showButtonSeparator( true );

	// ok i need some stuff in that pref dlg...
	//setIconListAllVisible(true);

	m_viewPage = new ViewPage();
	KPageWidgetItem *item = addPage( m_viewPage, i18n( "View" ) );
	item->setIcon( KIcon( "preferences-desktop-theme" ) );
	item->setHeader( i18n( "View Settings" ) );
	m_viewPage->setSettings( viewSets );

	m_diffPage = new DiffPage();
	item = addPage( m_diffPage, i18n( "Diff" ) );
	item->setIcon( KIcon( "text-x-patch" ) );
	item->setHeader( i18n( "Diff Settings" ) );
	m_diffPage->setSettings( diffSets );

//	frame = addVBoxPage( i18n( "" ), i18n( "" ), UserIcon( "" ) );

	connect( this, SIGNAL(defaultClicked()), SLOT(slotDefault()) );
	connect( this, SIGNAL(helpClicked()), SLOT(slotHelp()) );
	connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) );
	connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
	connect( this, SIGNAL(cancelClicked()), SLOT(slotCancel()) );

	adjustSize();
}
Пример #2
0
void Moto::initGui()
{
	ui.statusbar->showMessage( "Press F1 for help" );

    ui.speed_msr->setLabel( "x100" );
    ui.software->setEnabled( false );
    slotClosed();
    lockConfig();

    loadSettings();

    connect( this, SIGNAL(sigSpeed()),  this, SLOT(slotSpeed()) );
    connect( this, SIGNAL(sigStatus()), this, SLOT(slotStatus()) );
    connect( this, SIGNAL(sigConfig()), this, SLOT(slotConfig()) );
    connect( this, SIGNAL(sigOpened()), this, SLOT(slotOpened()) );
    connect( this, SIGNAL(sigClosed()), this, SLOT(slotClosed()) );

    // Binding GUI controls.
    connect( ui.throttle,  SIGNAL(valueChanged(int)),        this, SLOT(slotThrottleChanged(int)) );
    connect( ui.speed,     SIGNAL(valueChanged(int)),        this, SLOT(slotSpeedChanged(int)) );
    connect( ui.direction, SIGNAL(currentIndexChanged(int)), this, SLOT(slotDirectionChanged(int)) );
    connect( ui.unlock,    SIGNAL(clicked()),                this, SLOT(slotUnlock()) );
    connect( ui.apply,     SIGNAL(clicked()),                this, SLOT(slotApply()) );
    connect( ui.help,      SIGNAL(triggered()),              this, SLOT(slotHelp()) );

    m_speedTimer  = new QTimer();
    m_statusTimer = new QTimer();
    connect( m_speedTimer,  SIGNAL(timeout()), this, SLOT(slotSpeedTimeout()) );
    connect( m_statusTimer, SIGNAL(timeout()), this, SLOT(slotStatusTimeout()) );
    m_speedTimer->setInterval( 100 );
    m_statusTimer->setInterval( 1000 );
    m_speedTimer->start();
    m_statusTimer->start();
}
Пример #3
0
FirstRunDlg::FirstRunDlg(QWidget* const parent)
    : QWizard(parent),
      d(new Private)
{
    setWizardStyle(QWizard::ClassicStyle);
    setButtonLayout(QList<QWizard::WizardButton>() << QWizard::HelpButton
                                                   << QWizard::BackButton
                                                   << QWizard::CancelButton
                                                   << QWizard::NextButton
                                                   << QWizard::FinishButton);

    d->welcomePage    = new WelcomePage(this);    // First assistant page
    d->collectionPage = new CollectionPage(this);
    d->databasePage   = new DatabasePage(this);
    d->rawPage        = new RawPage(this);
    d->metadataPage   = new MetadataPage(this);
    d->previewPage    = new PreviewPage(this);
    d->openFilePage   = new OpenFilePage(this);
    d->tooltipsPage   = new TooltipsPage(this);

    // NOTE: Added here new assistant pages...

    d->startScanPage  = new StartScanPage(this);  // Last assistant page

    resize(600, 600);

    connect(button(QWizard::FinishButton), SIGNAL(clicked()),
            this, SLOT(slotFinishPressed()));

    connect(this, SIGNAL(helpRequested()),
            this, SLOT(slotHelp()));
}
DBoxFE_ProfileWizard::DBoxFE_ProfileWizard( QDialog *parent, Qt::WFlags flags )
    : QDialog( parent, flags ) {

  // setup grafical user interface (gui)
  setupUi( this );

  page = 0;

  // for download game database file
  m_http = new QHttp( this );
  connect( m_http, SIGNAL( requestFinished( int, bool ) ), this, SLOT( httpRequestFinished( int, bool ) ) );
  connect( m_http, SIGNAL( responseHeaderReceived( const QHttpResponseHeader & ) ), this, SLOT( readResponseHeader( const QHttpResponseHeader & ) ) );

  // connection
  connect( btnBack, SIGNAL( clicked() ), this, SLOT( slotBack() ) );
  connect( btnNext, SIGNAL( clicked() ), this, SLOT( slotNext() ) );
  connect( btnNext, SIGNAL( clicked() ), this, SLOT( slotFinish() ) );

  connect( btnHelp, SIGNAL( clicked() ), this, SLOT( slotHelp() ) );
  connect( btnAbort, SIGNAL( clicked() ), this, SLOT( slotAbort() ) );
  connect( btnSelectDir, SIGNAL( clicked() ), this, SLOT( slotSelectDir() ) );
  connect( btnSearch, SIGNAL( clicked() ), this, SLOT( slotSearch() ) );

  // enable button
  btnNext->setEnabled( true );

  // center the wiget on desktop screen
  QDesktopWidget *desktop = qApp->desktop();
  const QRect rect = desktop->availableGeometry( desktop->primaryScreen() );
  int left = ( rect.width() - width() ) / 2;
  int top = ( rect.height() - height() ) / 2;
  setGeometry( left, top, width(), height() );

  downloadFile();
}
Пример #5
0
void MainWindow::initUI(){

    ui.menuView->addSeparator();
    ui.menuView->addMenu(getStyleMenu(Settings::instance()->getStyle(), Settings::instance()->getPalette()));
    QString qmLocale = Settings::instance()->getLanguage();
    QString qmPath = QApplication::applicationDirPath() + QDir::separator () + QString(LANGUAGE_FILE_DIR);
    ui.menuView->addMenu(getLanguageMenu(qmPath, qmLocale));

    pluginsMenu = getPluginsMenu();
    menuBar()->insertMenu(ui.menuHelp->menuAction(), pluginsMenu);
    ui.toolBarPlugins->addAction(getPluginsManagementAction());


    connect(ui.actionBugReport, SIGNAL(triggered()), this, SLOT(slotBugReport()));

    connect(ui.actionAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));

    connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(slotAbout()));

    connect(ui.actionHelp, SIGNAL(triggered()), this, SLOT(slotHelp()));


    connect(ui.actionSystemConfigure, SIGNAL(triggered()), this, SLOT(slotSystemConfig()));

    connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(slotQuit()));


    //connect(ui.menuSubWindows, SIGNAL(aboutToShow()), this, SLOT(slotUpdateWindowActions()));
    connect(ui.mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(slotUpdateWindowActions()));





}
Пример #6
0
void TestPage::slotAccel (int id)
{
  switch (id)
  {
    case NewTest:
      newTest();
      break;  
    case DeleteTest:
      deleteTest();
      break;  
    case RenameTest:
      renameTest();
      break;  
    case OpenTest:
      openTest();
      break;  
    case CopyTest:
      copyTest();
      break;  
    case Help:
      slotHelp();
      break;  
    default:
      break;
  }
}
Пример #7
0
KGncPriceSourceDlg::KGncPriceSourceDlg(const QString &stockName, const QString& gncSource, QWidget * parent) : QDialog(parent), d(new Private)
{
  QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Help);
  QWidget *mainWidget = new QWidget(this);
  QVBoxLayout *mainLayout = new QVBoxLayout;
  setLayout(mainLayout);
  mainLayout->addWidget(mainWidget);
  QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
  okButton->setDefault(true);
  okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
  connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
  connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
  d->widget = new KGncPriceSourceDlgDecl();
  mainLayout->addWidget(d->widget);
  // signals and slots connections
  connect(d->widget->buttonsSource, SIGNAL(buttonClicked(int)), this, SLOT(buttonPressed(int)));
  connect(this, SIGNAL(helpClicked()), this, SLOT(slotHelp()));
  // initialize data fields
  d->widget->textStockName->setText(i18n("Investment: %1", stockName));
  d->widget->textGncSource->setText(i18n("Quote source: %1", gncSource));
  d->widget->listKnownSource->clear();
  d->widget->listKnownSource->insertItems(0, WebPriceQuote::quoteSources());
  d->widget->lineUserSource->setText(gncSource);
  d->widget->checkAlwaysUse->setChecked(true);
  d->widget->buttonsSource->setId(d->widget->buttonNoSource, 0);
  d->widget->buttonsSource->setId(d->widget->buttonSelectSource, 1);
  d->widget->buttonsSource->setId(d->widget->buttonUserSource, 2);
  d->widget->buttonsSource->button(0)->setChecked(true);
  mainLayout->addWidget(buttonBox);
  buttonPressed(0);
  return;
}
Пример #8
0
void ScannerPage::slotAccel (int id)
{
  switch (id)
  {
    case NewScanner:
      newScanner();
      break;
    case DeleteScanner:
      deleteScanner();
      break;
    case RenameScanner:
      renameScanner();
      break;
    case OpenScanner:
      openScanner();
      break;
    case RunScanner:
      runScanner();
      break;
    case Help:
      slotHelp();
      break;
    default:
      break;
  }
}
Пример #9
0
AddCatDialog::AddCatDialog( KStars *_ks )
        : KDialog( ( QWidget* )_ks ),  ks( _ks )
{
    QDir::setCurrent( QDir::homePath() );
    acd = new AddCatDialogUI(this);
    setMainWidget(acd);
    setCaption( i18n( "Import Catalog" ) );
    setButtons( KDialog::Help|KDialog::Ok|KDialog::Cancel );

    connect( acd->DataURL->lineEdit(), SIGNAL( lostFocus() ), this, SLOT( slotShowDataFile() ) );
    connect( acd->DataURL, SIGNAL( urlSelected( const KUrl & ) ),
             this, SLOT( slotShowDataFile() ) );
    connect( acd->PreviewButton, SIGNAL( clicked() ), this, SLOT( slotPreviewCatalog() ) );
    connect( this, SIGNAL( okClicked() ), this, SLOT( slotCreateCatalog() ) );
//    connect(this,SIGNAL(okClicked()),this,SLOT(slotOk()));
    connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
    connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));

    acd->FieldList->addItem( i18n( "ID Number" ) );
    acd->FieldList->addItem( i18n( "Right Ascension" ) );
    acd->FieldList->addItem( i18n( "Declination" ) );
    acd->FieldList->addItem( i18n( "Object Type" ) );

    acd->FieldPool->addItem( i18n( "Common Name" ) );
    acd->FieldPool->addItem( i18n( "Magnitude" ) );
    acd->FieldPool->addItem( i18n( "Flux" ) );
    acd->FieldPool->addItem( i18n( "Major Axis" ) );
    acd->FieldPool->addItem( i18n( "Minor Axis" ) );
    acd->FieldPool->addItem( i18n( "Position Angle" ) );
    acd->FieldPool->addItem( i18n( "Ignore" ) );
}
Пример #10
0
KXNeurTray::KXNeurTray()
 : KSystemTray()
{
    QPixmap pic;
    actions = new KActionCollection(this);
    menu = contextMenu();
    KApplication *app = KApplication::kApplication();

    // languages set in KXNeurApp::refresh_lang()
    menu->insertSeparator();

    mode = new KAction(i18n("Set manual mode"), "embedjs", 0, app, SLOT(slotUpdateMode()), actions);
    mode->plug(menu);
    run = new KAction(i18n("Stop xneur daemon"), "stop", 0, app, SLOT(slotUpdateRun()), actions);
    run->plug(menu);

    menu->insertSeparator();
    KAction *pref = KStdAction::preferences(app, SLOT(slotPref()), actions);
    pref->plug(menu);
    KAction *help = KStdAction::help(this, SLOT(slotHelp()), actions);
    help->plug(menu);
    KAction *about = KStdAction::aboutApp(this, SLOT(slotAbout()), actions);
    about->plug(menu);

    QObject::connect(menu, SIGNAL(activated(int)), app, SLOT(setMenuLang(int)));

    pic = kapp->iconLoader()->loadIcon("keyboard_layout", KIcon::Small);
    menu->changeTitle(menu->idAt(0), pic, i18n("KXNeur"));
    setPixmap(pic);
}
Пример #11
0
Preferences::Preferences(QWidget *w) : Q3TabDialog(w, "Preferences", FALSE, Qt::WDestructiveClose)
{
  helpFile = "preferences.html";

  setCaption(tr("Edit Prefs"));

  loadSettings();
  createGeneralPage();
  createColorPage();
  createFontPage();
  createMTPage(); // main tool bar
  createCTPage(); // chart tool bar
  createETPage(); // extra tool bar

  setApplyButton(tr("&Apply"));
  connect(this, SIGNAL(applyButtonPressed()), this, SLOT(slotSave()));

  setCancelButton(tr("&Ok"));
  //connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(exitDialog()));

  setOkButton(QString::null);

  setHelpButton();
  QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(slotHelp()));
  resize(sz);

}
Пример #12
0
void ScriptEditorWidget::contextMenuEvent(QContextMenuEvent * e)
{
	QMenu * pMenu = createStandardContextMenu();
	pMenu->addAction(__tr2qs_ctx("Context Sensitive Help","editor"),this,SLOT(slotHelp()),Qt::CTRL+Qt::Key_H);
	pMenu->addAction(__tr2qs_ctx("&Replace","editor"),this,SLOT(slotReplace()),Qt::CTRL+Qt::Key_R);
	pMenu->exec(e->globalPos());
	delete pMenu;
}
Пример #13
0
AlbumSelectDialog::AlbumSelectDialog(QWidget* const parent, PAlbum* const albumToSelect, const QString& header)
    : QDialog(parent),
      d(new Private)
{
    setWindowTitle(i18n("Select Album"));

    d->buttons = new QDialogButtonBox(QDialogButtonBox::Help | QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
    d->buttons->button(QDialogButtonBox::Ok)->setDefault(true);

    // -------------------------------------------------------------

    QWidget* const page     = new QWidget(this);
    QGridLayout* const grid = new QGridLayout(page);
    QLabel* const logo      = new QLabel(page);
    logo->setPixmap(QIcon::fromTheme(QLatin1String("digikam")).pixmap(QSize(48,48)));

    QLabel* const message   = new QLabel(page);
    message->setWordWrap(true);

    if (!header.isEmpty())
    {
        message->setText(header);
    }

    d->albumSel = new AlbumSelectWidget(page, albumToSelect);

    grid->addWidget(logo,        0, 0, 1, 1);
    grid->addWidget(message,     1, 0, 1, 1);
    grid->addWidget(d->albumSel, 0, 1, 3, 1);
    grid->setColumnStretch(1, 10);
    grid->setRowStretch(2, 10);
    grid->setContentsMargins(QMargins());
    grid->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));

    QVBoxLayout* const vbx = new QVBoxLayout(this);
    vbx->addWidget(page);
    vbx->addWidget(d->buttons);
    setLayout(vbx);

    // -------------------------------------------------------------

    connect(d->albumSel, SIGNAL(itemSelectionChanged()),
            this, SLOT(slotSelectionChanged()));

    connect(d->buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
            this, SLOT(accept()));

    connect(d->buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
            this, SLOT(reject()));

    connect(d->buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()),
            this, SLOT(slotHelp()));

    // -------------------------------------------------------------

    resize(500, 500);
    slotSelectionChanged();
}
Пример #14
0
KLoadTemplateDlg::KLoadTemplateDlg(QWidget* parent, const char* name) :
  KLoadTemplateDlgDecl(parent, name)
{
  buttonOk->setGuiItem(KStdGuiItem::ok());
  buttonCancel->setGuiItem(KStdGuiItem::cancel());
  buttonHelp->setGuiItem(KStdGuiItem::help());

  connect(buttonHelp, SIGNAL(clicked()), this, SLOT(slotHelp()));
}
Пример #15
0
NamespaceEditDlg::NamespaceEditDlg(bool create, NamespaceEntry& entry, QWidget* const parent)
    : QDialog(parent),
      d(new Private())
{
    setModal(true);

    d->buttons = new QDialogButtonBox(QDialogButtonBox::Help |
                                      QDialogButtonBox::Ok   |
                                      QDialogButtonBox::Cancel, this);

    d->buttons->button(QDialogButtonBox::Ok)->setDefault(true);

    if (create)
    {
        setWindowTitle(i18n("New Xmp Namespace"));
    }
    else
    {
        setWindowTitle(i18n("Edit Xmp Namespace"));
    }

    d->create = create;
    d->nsType = entry.nsType;

    setupTagGui(entry);

    // --------------------------------------------------------

    connect(d->buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
            this, SLOT(accept()));

    connect(d->buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
            this, SLOT(reject()));

    connect(d->buttons->button(QDialogButtonBox::Help), SIGNAL(clicked()),
            this, SLOT(slotHelp()));

    // --------------------------------------------------------

    if (!d->create)
    {
        populateFields(entry);
    }

    setType(entry.nsType);

    if (entry.isDefault)
    {
        makeReadOnly();
    }

    qCDebug(DIGIKAM_GENERAL_LOG) << "Entry type" << entry.nsType << "subspace" << entry.subspace << entry.isDefault;
    adjustSize();
}
Пример #16
0
calculator::calculator(QWidget *parent) : KDialog(parent)
{
    setWindowTitle(i18n("Chemical Calculator"));
    setButtons(Help | Close);
    setDefaultButton(Close);

    ui.setupUi(mainWidget());

    int maxTextWidth = 0;
    QStyleOptionViewItem option;
    option.initFrom(ui.tree);
    for (int i = 0; i < ui.tree->topLevelItemCount(); ++i) {
        maxTextWidth = qMax(maxTextWidth, ui.tree->itemDelegate()->sizeHint(option, ui.tree->model()->index(i, 0)).width());
    }
    // 20 because we want some margins, not a too tight text
    ui.tree->setMaximumWidth(qMax(ui.tree->maximumWidth(), maxTextWidth + 20));

    // Add the nuclear calculator to the user interface
    m_nuclearCalculator = new nuclearCalculator(this);
    ui.stack->addWidget(m_nuclearCalculator);
    // Add the gas calculator to the user interface
    m_gasCalculator = new gasCalculator(this);
    ui.stack->addWidget(m_gasCalculator);
    // Add the concentration calculator to the user interface
    m_concCalculator = new concCalculator(this);
    ui.stack->addWidget(m_concCalculator);
    // Add the molecular mass Calculator widget to the user interface
    m_moleCalculator = new MolcalcWidget(this);
    ui.stack->addWidget(m_moleCalculator);
    // Add the molecular mass Calculator widget to the user interface
    m_titraCalculator = new titrationCalculator(this);
    ui.stack->addWidget(m_titraCalculator);

#ifdef HAVE_FACILE
    // Add the equation balancer widget to the user interface
    QTreeWidgetItem *treeItem = new QTreeWidgetItem(ui.tree);
    treeItem->setText(0, i18n("Equation Balancer"));

    m_equationBalancer = new EQChemDialog(this);
    ui.stack->addWidget(m_equationBalancer);
#endif
    // Add an image to the file
    ui.pic->setPixmap((QIcon::fromTheme("calculate")).pixmap(128,128));

    // Connect the tree item selection signal to the corresponding slot
    connect(ui.tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this,
            SLOT(slotItemSelection(QTreeWidgetItem*)));

    ui.tree->setCurrentItem(ui.tree->topLevelItem(0), 0, QItemSelectionModel::ToggleCurrent);

    // help clicked
    connect(this, SIGNAL(helpClicked()), this, SLOT(slotHelp()));
}
Пример #17
0
Installer::Installer(QWidget *parent) : QMainWindow(parent)
{
    setupUi(this);
    translator = new QTranslator();

    connect(backButton, SIGNAL(clicked()), this, SLOT(slotBack()));
    connect(nextButton, SIGNAL(clicked()), this, SLOT(slotNext()));

    connect(helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
    connect(pushTouchKeyboard, SIGNAL(clicked()), this, SLOT(slotPushVirtKeyboard()));
    connect(pushChangeKeyLayout, SIGNAL(clicked()), this, SLOT(slotPushKeyLayout()));

    connect(lineHostname,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckHost()));

    connect(lineRootPW, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));
    connect(lineRootPW2, SIGNAL(textChanged ( const QString &)), this, SLOT(slotCheckRootPW()));

    connect(lineName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(lineName,SIGNAL(editingFinished()),this,SLOT(slotSuggestUsername()));
    connect(lineUsername,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));
    connect(linePW2,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckUser()));

    backButton->setText(tr("&Back"));
    nextButton->setText(tr("&Next"));


    // Load the keyboard info
    keyModels = Scripts::Backend::keyModels();
    keyLayouts = Scripts::Backend::keyLayouts();

    // Load the timezones
    comboBoxTimezone->clear();
    QString curZone = Scripts::Backend::guessTimezone();
    comboBoxTimezone->addItems(Scripts::Backend::timezones());
    if ( ! curZone.isEmpty() ) {
      int index = comboBoxTimezone->findText(curZone, Qt::MatchStartsWith);
      if (index != -1)
         comboBoxTimezone->setCurrentIndex(index);
    } else {
      // Set America/New_York to default
      int index = comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith);
      if (index != -1)
         comboBoxTimezone->setCurrentIndex(index);
    }

    // Load the hostname
    lineHostname->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1));

    // Start on the first screen
    installStackWidget->setCurrentIndex(0);
    backButton->setVisible(false);
}
Пример #18
0
int CDSNWizard::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWizard::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotHelp(); break;
        }
        _id -= 1;
    }
    return _id;
}
ViewConfigureDialog::ViewConfigureDialog( ViewConfigureWidget *wdg, const QString &viewName,
        QWidget *parent )
    : KDialog( parent ), mConfigWidget( wdg )
{
    setCaption( i18n( "Modify View: " ) + viewName );
    setButtons( Help | Ok | Cancel );
    setDefaultButton( Ok );
    showButtonSeparator( true );

    setMainWidget( mConfigWidget );
    connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
    resize( 600, 300 );
}
Пример #20
0
void KTimerDialog::slotInternalTimeout()
{
    emit timerTimeout();
    switch(buttonOnTimeout)
    {
        case Help:
            slotHelp();
            break;
        case Default:
            slotDefault();
            break;
        case Ok:
            slotOk();
            break;
        case Apply:
            applyPressed();
            break;
        case Try:
            slotTry();
            break;
        case Cancel:
            slotCancel();
            break;
        case Close:
            slotClose();
            break;
        /*case User1:
            slotUser1();
            break;
        case User2:
            slotUser2();
            break;*/
        case User3:
            slotUser3();
            break;
        case No:
            slotNo();
            break;
        case Yes:
            slotCancel();
            break;
        case Details:
            slotDetails();
            break;
        case Filler:
        case Stretch:
            kdDebug() << "Cannot execute button code " << buttonOnTimeout << endl;
            break;
    }
}
Пример #21
0
FirstRunDlg::FirstRunDlg(QWidget* const parent)
    : QWizard(parent),
      d(new Private)
{
    setWizardStyle(QWizard::ClassicStyle);
    setButtonLayout(QList<QWizard::WizardButton>() << QWizard::HelpButton
                                                   << QWizard::BackButton
                                                   << QWizard::CancelButton
                                                   << QWizard::NextButton
                                                   << QWizard::FinishButton);

    bool migrateAvailable;

#ifdef Q_OS_LINUX
    ::Kdelibs4Migration migration;

    // If there's a digikamrc file in $KDEHOME/share/config,
    // then we create the migration page in the wizard
    migrateAvailable = !migration.locateLocal("config", QLatin1String("digikamrc")).isEmpty();
#else
    migrateAvailable = false;
#endif

    d->welcomePage    = new WelcomePage(this);    // First assistant page

    if (migrateAvailable)
       d->migrateFromDigikam4Page = new MigrateFromDigikam4Page(this);

    d->collectionPage = new CollectionPage(this);
    d->databasePage   = new DatabasePage(this);
    d->rawPage        = new RawPage(this);
    d->metadataPage   = new MetadataPage(this);
    d->previewPage    = new PreviewPage(this);
    d->openFilePage   = new OpenFilePage(this);
    d->tooltipsPage   = new TooltipsPage(this);

    // NOTE: Added here new assistant pages...

    d->startScanPage  = new StartScanPage(this);  // Last assistant page

    resize(600, 600);

    connect(button(QWizard::FinishButton), SIGNAL(clicked()),
            this, SLOT(slotFinishPressed()));

    connect(this, SIGNAL(helpRequested()),
            this, SLOT(slotHelp()));
}
Пример #22
0
int minesweeper::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: slotHelp(); break;
        case 1: newGame(); break;
        case 2: updateTime(); break;
        default: ;
        }
        _id -= 3;
    }
    return _id;
}
Пример #23
0
AuthDialogImpl::AuthDialogImpl(const QString &realm, const QString &user, QWidget *parent)
    : QDialog(parent)
    , m_AuthWidget(new AuthDialogWidget(realm, user, parent))
{
    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);
    mainLayout->addWidget(m_AuthWidget);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::Help);
    QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(helpRequested()), this, SLOT(slotHelp()));
    mainLayout->addWidget(buttonBox);
}
Пример #24
0
RSDialog::RSDialog(QWidget* parent) : KDialog(parent)
{
    setCaption(i18n("Risks/Security Phrases"));
    setButtons(Help | Close);

    createRPhrases();
    createSPhrases();

    ui.setupUi(mainWidget());

    connect(ui.filterButton, SIGNAL(clicked()),
            this, SLOT(filter()));
    connect(this, SIGNAL(helpClicked()),
            this, SLOT(slotHelp()));

        filter();
}
void setupHelpButton(KDialog* dialog, KAboutData* aboutData)
{
    QObject::disconnect(dialog, SIGNAL(helpClicked()),
                        dialog, SLOT(slotHelp()));

    KHelpMenu* helpMenu = new KHelpMenu(dialog, aboutData, false);
    KMenu* menu         = helpMenu->menu();
    menu->removeAction(menu->actions().first());

    QAction* openHandbookAction = new QAction(i18n("Handbook"), dialog);

    QObject::connect(openHandbookAction, SIGNAL(triggered(bool)),
                     dialog, SLOT(slotHelp()));

    menu->insertAction(menu->actions().first(), openHandbookAction);
    dialog->button(KDialog::Help)->setMenu(menu);
}
Пример #26
0
KSelectTransactionsDlg::KSelectTransactionsDlg(const MyMoneyAccount& _account, QWidget* parent) :
    KSelectTransactionsDlgDecl(parent),
    m_account(_account)
{
  // setup descriptive texts
  setWindowTitle(i18n("Select Transaction"));
  m_description->setText(i18n("Select a transaction and press the OK button or use Cancel to select none."));

  // clear current register contents
  m_register->clear();

  // no selection possible
  m_register->setSelectionMode(QTableWidget::SingleSelection);

  // setup header font
  QFont font = KMyMoneyGlobalSettings::listHeaderFont();
  QFontMetrics fm(font);
  int height = fm.lineSpacing() + 6;
  m_register->horizontalHeader()->setMinimumHeight(height);
  m_register->horizontalHeader()->setMaximumHeight(height);
  m_register->horizontalHeader()->setFont(font);

  // setup cell font
  font = KMyMoneyGlobalSettings::listCellFont();
  m_register->setFont(font);

  // ... setup the register columns ...
  m_register->setupRegister(m_account);

  // setup buttons
  m_helpButton->setGuiItem(KStandardGuiItem::help());
  buttonOk->setGuiItem(KStandardGuiItem::ok());
  buttonCancel->setGuiItem(KStandardGuiItem::cancel());

  // default is to need at least one transaction selected
  buttonOk->setDisabled(true);

  // catch some events from the register
  m_register->installEventFilter(this);

  connect(m_register, SIGNAL(transactionsSelected(KMyMoneyRegister::SelectedTransactions)), this, SLOT(slotEnableOk(KMyMoneyRegister::SelectedTransactions)));
  connect(m_register, SIGNAL(editTransaction()), this, SLOT(accept()));

  connect(m_helpButton, SIGNAL(clicked()), this, SLOT(slotHelp()));
}
XXPortSelectDialog::XXPortSelectDialog( KAB::Core *core, bool sort,
                                        QWidget* parent )
    : KDialog( parent ), mCore( core ),
      mUseSorting( sort )
{
  setCaption( i18n( "Choose Which Contacts to Export" ) );
  setButtons( Help | Ok | Cancel );
  setDefaultButton( Ok );
  setModal( true );
  showButtonSeparator( true );

  initGUI();

  connect( mFiltersCombo, SIGNAL( activated( int ) ),
           SLOT( filterChanged( int ) ) );

  // setup filters
  mFilters = Filter::restore( KGlobal::config().data(), "Filter" );
  Filter::List::ConstIterator filterIt;
  QStringList filters;
  for ( filterIt = mFilters.constBegin(); filterIt != mFilters.constEnd(); ++filterIt )
    filters.append( (*filterIt).name() );

  mFiltersCombo->addItems( filters );
  mUseFilters->setEnabled( filters.count() > 0 );

  // setup categories
  const QStringList categories = KABPrefs::instance()->customCategories();
  mCategoriesView->setCategories( categories );
  mUseCategories->setEnabled( categories.count() > 0 );

  int count = mCore->selectedUIDs().count();
  mUseSelection->setEnabled( count != 0 );
  mUseSelection->setChecked( count  > 0 );

  mSortTypeCombo->addItem( i18nc( "@item:inlistbox Sort order", "Ascending" ) );
  mSortTypeCombo->addItem( i18nc( "@item:inlistbox Sort order", "Descending" ) );

  mFields = mCore->addressBook()->fields( KABC::Field::All );
  KABC::Field::List::ConstIterator fieldIt;
  for ( fieldIt = mFields.constBegin(); fieldIt != mFields.constEnd(); ++fieldIt )
    mFieldCombo->addItem( (*fieldIt)->label() );
  connect(this,SIGNAL(helpClicked()),this,SLOT(slotHelp()));
}
Пример #28
0
TestPage::TestPage (QWidget *w, MainMenubar *mb, DBIndex *i) : QWidget (w)
{
  chartIndex = i;
  menubar = mb;
  idir.setFilter(QDir::Dirs);

  QVBoxLayout *vbox = new QVBoxLayout(this);
  vbox->setMargin(0);
  vbox->setSpacing(5);
  
  search = new QLineEdit(this);
  search->setText("*");
  connect(search, SIGNAL(textChanged(const QString &)), this, SLOT(searchChanged(const QString &)));
  QToolTip::add(search, tr("List Filter, e.g. s* or sb*"));
  vbox->addWidget(search);

  list = new QListBox(this);
  connect(list, SIGNAL(contextMenuRequested(QListBoxItem *, const QPoint &)), this,
          SLOT(rightClick(QListBoxItem *)));
  connect(list, SIGNAL(highlighted(const QString &)), this, SLOT(testSelected(const QString &)));
  connect(list, SIGNAL(doubleClicked(QListBoxItem *)), this, SLOT(doubleClick(QListBoxItem *)));
  vbox->addWidget(list);
  
  menu = new QPopupMenu(this);
  menu->insertItem(QPixmap(newchart), tr("&New Rule		Ctrl+N"), this, SLOT(newTest()));
  menu->insertItem(QPixmap(open), tr("&Open Rule		Ctrl+O"), this, SLOT(openTest()));
  menu->insertItem(QPixmap(deleteitem), tr("&Delete Rule	Ctrl+D"), this, SLOT(deleteTest()));
  menu->insertItem(QPixmap(renam), tr("&Rename Rule		Ctrl+R"), this, SLOT(renameTest()));
  menu->insertItem(QPixmap(copypic), tr("&Copy Rule		Ctrl+Y"), this, SLOT(copyTest()));
  menu->insertSeparator(-1);
  menu->insertItem(QPixmap(help), tr("&Help		Ctrl+H"), this, SLOT(slotHelp()));

  QAccel *a = new QAccel(this);
  connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int)));
  a->insertItem(CTRL+Key_N, NewTest);
  a->insertItem(CTRL+Key_O, OpenTest);
  a->insertItem(CTRL+Key_D, DeleteTest);
  a->insertItem(CTRL+Key_R, RenameTest);
  a->insertItem(CTRL+Key_Y, CopyTest);
  a->insertItem(CTRL+Key_H, Help);
  
  updateList();
  testNoSelection();
}
Пример #29
0
ScannerPage::ScannerPage (QWidget *w, DBIndex *i) : QWidget (w)
{
  chartIndex = i;
  idir.setFilter(QDir::Files);

  Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
  vbox->setMargin(0);
  vbox->setSpacing(5);

  search = new QLineEdit(this);
  search->setText("*");
  connect(search, SIGNAL(textChanged(const QString &)), this, SLOT(searchChanged(const QString &)));
  QToolTip::add(search, tr("List Filter, e.g. s* or sb*"));
  vbox->addWidget(search);

  list = new Q3ListBox(this);
  connect(list, SIGNAL(contextMenuRequested(Q3ListBoxItem *, const QPoint &)), this,
          SLOT(rightClick(Q3ListBoxItem *)));
  connect(list, SIGNAL(highlighted(const QString &)), this, SLOT(scannerSelected(const QString &)));
  connect(list, SIGNAL(doubleClicked(Q3ListBoxItem *)), this, SLOT(doubleClick(Q3ListBoxItem *)));
  vbox->addWidget(list);

  menu = new QMenu(this);
  menu->insertItem(QPixmap(newchart), tr("&New Scanner		Ctrl+N"), this, SLOT(newScanner()));
  menu->insertItem(QPixmap(openitem), tr("&Open Scanner		Ctrl+O"), this, SLOT(openScanner()));
  menu->insertItem(QPixmap(deleteitem), tr("&Delete Scanner	Ctrl+D"), this, SLOT(deleteScanner()));
  menu->insertItem(QPixmap(renameitem), tr("&Rename Scanner		Ctrl+R"), this, SLOT(renameScanner()));
  menu->insertItem(QPixmap(macro), tr("R&un Scanner		Ctrl+U"), this, SLOT(runScanner()));
  menu->insertSeparator(-1);
  menu->insertItem(QPixmap(help), tr("&Help		Ctrl+H"), this, SLOT(slotHelp()));

  Q3Accel *a = new Q3Accel(this);
  connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int)));
  a->insertItem(Qt::CTRL+Qt::Key_N, NewScanner);
  a->insertItem(Qt::CTRL+Qt::Key_O, OpenScanner);
  a->insertItem(Qt::CTRL+Qt::Key_D, DeleteScanner);
  a->insertItem(Qt::CTRL+Qt::Key_R, RenameScanner);
  a->insertItem(Qt::CTRL+Qt::Key_U, RunScanner);
  a->insertItem(Qt::CTRL+Qt::Key_H, Help);

  refreshList();
  scannerSelected(QString());
}
Пример #30
0
CalWizard::CalWizard(KIPI::Interface* interface, QWidget* parent)
    : KAssistantDialog(parent),
      interface_(interface)
{
    setMaximumSize(800, 600);
    cSettings_   = CalSettings::instance(this);

    // ---------------------------------------------------------------

    wTemplate_   = new CalTemplate(interface, this);
    addPage(wTemplate_, i18n("Create Template for Calendar"));

    // ---------------------------------------------------------------

    wEvents_     = new QWidget(this);
    calEventsUI.setupUi(wEvents_);
    addPage(wEvents_, i18n("Choose events to show on the Calendar"));

    // ---------------------------------------------------------------

    wPrintLabel_ = new QLabel(this);
    wPrintLabel_->setIndent(20);
    wPrintLabel_->setWordWrap(true);

    wPrintPage_ = addPage(wPrintLabel_, i18n("Print"));

    // ---------------------------------------------------------------

    wFinish_     = new QWidget(this);
    calProgressUI.setupUi(wFinish_);
    wFinishPage_ = addPage(wFinish_, i18n("Printing"));

    // ---------------------------------------------------------------

    // About data and help button.

    m_about = new KIPIPlugins::KPAboutData(ki18n("Calendar"),
                                           0,
                                           KAboutData::License_GPL,
                                           ki18n("A Kipi plugin to create a calendar"),
                                           ki18n("(c) 2003-2005, Renchi Raju\n"
                                                 "(c) 2006 Tom Albers\n"
                                                 "(c) 2007-2008 Orgad Shaneh"));

    m_about->addAuthor(ki18n("Orgad Shaneh"), ki18n("Author and maintainer"),
                       "*****@*****.**");

    m_about->addAuthor(ki18n("Tom Albers"), ki18n("Former author and maintainer"),
                       "*****@*****.**");

    m_about->addAuthor(ki18n("Renchi Raju"), ki18n("Former author and maintainer"),
                       "renchi dot raju at gmail dot com");

    disconnect(this, SIGNAL(helpClicked()),
               this, SLOT(slotHelp()));

    KHelpMenu* helpMenu = new KHelpMenu(this, m_about, false);
    helpMenu->menu()->removeAction(helpMenu->menu()->actions().first());
    QAction* handbook   = new QAction(i18n("Handbook"), this);
    connect(handbook, SIGNAL(triggered()),
            this, SLOT(slotHelp()));
    helpMenu->menu()->insertAction(helpMenu->menu()->actions().first(), handbook);
    button(Help)->setMenu(helpMenu->menu());

    // ------------------------------------------

    printThread_ = 0;
    printer_     = 0;

    connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*,KPageWidgetItem*)),
            this, SLOT(slotPageSelected(KPageWidgetItem*,KPageWidgetItem*)));

    setCaption(i18n("Create Calendar"));
}