Exemple #1
0
ModifyRelationDialog::ModifyRelationDialog(Project &project, Relation *rel, QWidget *p)
    : AddRelationDialog(project, rel, p, i18n("Edit Relationship"), Ok|Cancel|User1)
{
    setButtonText( KDialog::User1, i18n("Delete") );
    m_deleted = false;
    enableButtonOk(false);

    connect(this, SIGNAL(user1Clicked()), SLOT(slotUser1()));
}
Exemple #2
0
KSpellDlg::KSpellDlg( QWidget * parent, const char * name, bool _progressbar, bool _modal )
  : KDialogBase(
      parent, name, _modal, i18n("Check Spelling"), Help|Cancel|User1,
      Cancel, true, i18n("&Finished")
    ),
    progressbar( false )
{
  Q_UNUSED( _progressbar );
  d = new KSpellDlgPrivate;
  d->ui = new KSpellUI( this );
  setMainWidget( d->ui );

  connect( d->ui->m_replaceBtn, SIGNAL(clicked()),
           this, SLOT(replace()));
  connect( this, SIGNAL(ready(bool)),
           d->ui->m_replaceBtn, SLOT(setEnabled(bool)) );

  connect( d->ui->m_replaceAllBtn, SIGNAL(clicked()), this, SLOT(replaceAll()));
  connect(this, SIGNAL(ready(bool)), d->ui->m_replaceAllBtn, SLOT(setEnabled(bool)));

  connect( d->ui->m_skipBtn, SIGNAL(clicked()), this, SLOT(ignore()));
  connect( this, SIGNAL(ready(bool)), d->ui->m_skipBtn, SLOT(setEnabled(bool)));

  connect( d->ui->m_skipAllBtn, SIGNAL(clicked()), this, SLOT(ignoreAll()));
  connect( this, SIGNAL(ready(bool)), d->ui->m_skipAllBtn, SLOT(setEnabled(bool)));

  connect( d->ui->m_addBtn, SIGNAL(clicked()), this, SLOT(add()));
  connect( this, SIGNAL(ready(bool)), d->ui->m_addBtn, SLOT(setEnabled(bool)));

  connect( d->ui->m_suggestBtn, SIGNAL(clicked()), this, SLOT(suggest()));
  connect( this, SIGNAL(ready(bool)), d->ui->m_suggestBtn, SLOT(setEnabled(bool)) );
  d->ui->m_suggestBtn->hide();

  connect(this, SIGNAL(user1Clicked()), this, SLOT(stop()));

  connect( d->ui->m_replacement, SIGNAL(textChanged(const QString &)),
           SLOT(textChanged(const QString &)) );

  connect( d->ui->m_replacement, SIGNAL(returnPressed()),   SLOT(replace()) );
  connect( d->ui->m_suggestions, SIGNAL(selectionChanged(QListViewItem*)),
           SLOT(slotSelectionChanged(QListViewItem*)) );

  connect( d->ui->m_suggestions, SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int ) ),
           SLOT( replace() ) );
  d->spellConfig = new KSpellConfig( 0, 0 ,0, false );
  d->spellConfig->fillDicts( d->ui->m_language );
  connect( d->ui->m_language, SIGNAL(activated(int)),
	   d->spellConfig, SLOT(sSetDictionary(int)) );
  connect( d->spellConfig, SIGNAL(configChanged()),
           SLOT(slotConfigChanged()) );

  setHelp( "spelldlg", "kspell" );
  setMinimumSize( sizeHint() );
  emit ready( false );
}
Exemple #3
0
void ConfigChecker::run()
{
	m_tester = new Tester(this, "configtester");

	connect(m_tester, SIGNAL(started()), this, SLOT(started()));
	connect(m_tester, SIGNAL(percentageDone(int)), this, SLOT(setPercentageDone(int)));
	connect(m_tester, SIGNAL(finished(bool)), this, SLOT(finished(bool)));
	connect(this, SIGNAL(user1Clicked()), this, SLOT(saveResults()));

	m_tester->runTests();
}
Exemple #4
0
NamedAreaDialog::NamedAreaDialog(QWidget* parent, Selection* selection)
        : KDialog(parent)
        , m_selection(selection)
{
    setButtons(KDialog::Ok | KDialog::Close | KDialog::User1 | KDialog::User2 | KDialog::User3);
    setButtonsOrientation(Qt::Vertical);
    setButtonText(KDialog::Ok, i18n("&Select"));
    setButtonText(KDialog::User1, i18n("&Remove"));
    setButtonText(KDialog::User2, i18n("&Edit..."));
    setButtonText(KDialog::User3, i18n("&New..."));
    setCaption(i18n("Named Areas"));
    setModal(true);
    setObjectName("NamedAreaDialog");

    QWidget* widget = new QWidget(this);
    setMainWidget(widget);

    QVBoxLayout *vboxLayout = new QVBoxLayout(widget);
    vboxLayout->setMargin(0);
    vboxLayout->setSpacing(KDialog::spacingHint());

    m_list = new KListWidget(this);
    m_list->setSortingEnabled(true);
    vboxLayout->addWidget(m_list);

    m_rangeName = new QLabel(this);
    m_rangeName->setText(i18n("Area: %1", QString()));
    vboxLayout->addWidget(m_rangeName);

    const QList<QString> namedAreas = m_selection->activeSheet()->map()->namedAreaManager()->areaNames();
    for (int i = 0; i < namedAreas.count(); ++i)
        m_list->addItem(namedAreas[i]);

    if (m_list->count() == 0) {
        enableButtonOk(false);
        enableButton(KDialog::User1, false);
        enableButton(KDialog::User2, false);
        m_list->setCurrentRow(0);
    }

    connect(this, SIGNAL(okClicked()), this, SLOT(slotOk()));
    connect(this, SIGNAL(cancelClicked()), this, SLOT(slotClose()));
    connect(this, SIGNAL(user1Clicked()), this, SLOT(slotRemove()));
    connect(this, SIGNAL(user2Clicked()), this, SLOT(slotEdit()));
    connect(this, SIGNAL(user3Clicked()), this, SLOT(slotNew()));
    connect(m_list, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(slotOk()));
    connect(m_list, SIGNAL(currentTextChanged(const QString&)),
            this, SLOT(displayAreaValues(const QString&)));

    if (m_list->count() > 0)
        m_list->setCurrentItem(m_list->item(0));

    m_list->setFocus();
}
RemoveDuplicates::RemoveDuplicates():KDialog()
{
    setWindowTitle(i18n("Remove Duplicates"));
    setWindowIcon(KIcon("nepomuk"));
    setButtons(User1 | Cancel);
    setButtonIcon(User1,KIcon("edit-delete"));
    setButtonText(User1,i18n("&Delete"));
    setMinimumSize(500,500);
    connect(this,SIGNAL(user1Clicked()),this,SLOT(slotDeleteDuplicates()));
    setUpGui();
    loadDuplicates();
}
Exemple #6
0
KoCompletionDia::KoCompletionDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat )
    : KDialogBase( parent, name , true, i18n( "Completion" ), Ok|Cancel|User1,
      Ok, true, KGuiItem( i18n( "&Reset" ), "undo" ) )
{
    QVBox *page = makeVBoxMainWidget();
    m_widget = new KoCompletion(page, autoFormat);
    m_widget->layout()->setMargin(0);
    connect( this, SIGNAL( user1Clicked() ), m_widget, SLOT(slotResetConf()));
    setButtonWhatsThis(Ok,i18n("This will save your options."));
    setButtonWhatsThis(Cancel,i18n("This will abort all changes."));
    setButtonWhatsThis(User1,i18n("This will reset to the state after you clicked on the Make Default button."));
}
Exemple #7
0
DlgSpecChar::DlgSpecChar(QWidget *parent, const QFont &font, const QChar &chr) : KDialog(parent)
{
  setCaption( i18nc("@title:window select character dialog", "Select Character") );
  setButtons(User1 | Cancel);
  setDefaultButton(User1);
  setModal(true);

  initDialog(font, chr);

  setButtonText( User1, i18nc("@action:button select", "&Select") );
  setButtonToolTip( User1, i18nc("@info:tooltip select this character", "Select this character") );
  connect(this,SIGNAL(user1Clicked()),this,SLOT(slotUser1()));
}
ModifyRelationDialog::ModifyRelationDialog(Project &project, Relation *rel, QWidget *p)
    : AddRelationDialog(project, rel, p, i18nc( "@title:window", "Edit Dependency"), Ok|Cancel|User1)
{
    m_deleterelation = false;

    setButtonText( KDialog::User1, i18nc( "@action:button", "Delete") );
    m_deleted = false;
    enableButtonOk(false);
    
    connect(this, SIGNAL(user1Clicked()), SLOT(slotUser1()));
    
    connect(&project, SIGNAL(relationRemoved(Relation*)), SLOT(slotRelationRemoved(Relation*)));
}
ExportWorksheetDialog::ExportWorksheetDialog(QWidget* parent) : KDialog(parent) {
	mainWidget = new QWidget(this);
	ui.setupUi(mainWidget);

	KUrlCompletion *comp = new KUrlCompletion();
    ui.kleFileName->setCompletionObject(comp);

	ui.bOpen->setIcon( KIcon("document-open") );

	ui.cbFormat->addItem(KIcon("application-pdf"), "Portable data format (PDF)");
	ui.cbFormat->addItem(KIcon("image-x-eps"), "Encapsulated PostScript (EPS)");
	ui.cbFormat->addItem(KIcon("image-svg+xml"), "Scalable Vector Graphics (SVG)");
	ui.cbFormat->insertSeparator(3);
	ui.cbFormat->addItem(KIcon("image-x-generic"), "Portable Network Graphics (PNG)");

	ui.cbExportArea->addItem(i18n("Object's bounding box"));
	ui.cbExportArea->addItem(i18n("Current selection"));
	ui.cbExportArea->addItem(i18n("Complete worksheet"));

	ui.cbResolution->addItem(QString::number(QApplication::desktop()->physicalDpiX()) + " (" + i18n("desktop") + ')');
	ui.cbResolution->addItem("100");
	ui.cbResolution->addItem("150");
	ui.cbResolution->addItem("200");
	ui.cbResolution->addItem("300");
	ui.cbResolution->addItem("600");
	ui.cbResolution->setValidator(new QIntValidator(ui.cbResolution));

	setMainWidget(mainWidget);

	setButtons(KDialog::Ok | KDialog::User1 | KDialog::Cancel);

	connect( ui.cbFormat, SIGNAL(currentIndexChanged(int)), SLOT(formatChanged(int)) );
	connect( ui.bOpen, SIGNAL(clicked()), this, SLOT (selectFile()) );
	connect( ui.kleFileName, SIGNAL(textChanged(QString)), this, SLOT(fileNameChanged(QString)) );
	connect(this,SIGNAL(user1Clicked()), this, SLOT(toggleOptions()));

	setCaption(i18n("Export worksheet"));
	setWindowIcon(KIcon("document-export-database"));

	//restore saved setting
	KConfigGroup conf(KSharedConfig::openConfig(), "ExportWorksheetDialog");
	ui.cbFormat->setCurrentIndex(conf.readEntry("Format", 0));
	ui.cbExportArea->setCurrentIndex(conf.readEntry("Area", 0));
	ui.chkExportBackground->setChecked(conf.readEntry("Background", true));
	ui.cbResolution->setCurrentIndex(conf.readEntry("Resolution", 0));
	m_showOptions = conf.readEntry("ShowOptions", false);
	ui.gbOptions->setVisible(m_showOptions);
	m_showOptions ? setButtonText(KDialog::User1,i18n("Hide Options")) : setButtonText(KDialog::User1,i18n("Show Options"));
	restoreDialogSize(conf);
}
KOCounterDialog::KOCounterDialog(QWidget *parent, const char *name)
    : KDialogBase(parent, name, false, i18n("Counter-Event Viewer"),
                  User1 | User2, User1, false, i18n("Decline"), i18n("Accept"))
{
    mEventViewer = new KOEventViewer(this);
    setMainWidget(mEventViewer);

    connect(this, SIGNAL(user1Clicked()), SLOT(slotCancel()));
    connect(this, SIGNAL(user2Clicked()), SLOT(slotOk()));

    // FIXME: Set a sensible size (based on the content?).
    setMinimumSize(300, 200);
    resize(320, 300);
}
Exemple #11
0
KOCRBase::KOCRBase( QWidget *parent, KSpellConfig *spellConfig,
                    KDialogBase::DialogType face )
   :KDialogBase( face, i18n("Optical Character Recognition"),
		 User2|Close|User1, User1, parent,0, false, true,
		 KGuiItem( i18n("Start OCR" ), "launch",
			   i18n("Start the Optical Character Recognition process" )),
                 KGuiItem( i18n("Cancel" ), "stopocr",
			   i18n("Stop the OCR Process" ))),
    m_animation(0L),
    m_metaBox(0L),
    m_imgHBox(0L),
    m_previewPix(0L),
    m_currImg(0L),
    m_spellConfig(spellConfig),
    m_wantSpellCfg(true),
    m_userWantsSpellCheck(true),
    m_cbWantCheck(0L),
    m_gbSpellOpts(0L)
{
    kdDebug(28000) << "OCR Base Dialog!" << endl;
    // Layout-Boxes

    KConfig *konf = KGlobal::config ();
    KConfigGroupSaver gs( konf, CFG_OCR_KSPELL );
    m_userWantsSpellCheck = konf->readBoolEntry(CFG_WANT_KSPELL, true);

    /* Connect signals which disable the fields and store the configuration */
    connect( this, SIGNAL( user1Clicked()), this, SLOT( writeConfig()));
    connect( this, SIGNAL( user1Clicked()), this, SLOT( startOCR() ));
    connect( this, SIGNAL( user2Clicked()), this, SLOT( stopOCR() ));
    m_previewSize.setWidth(200);
    m_previewSize.setHeight(300);

    enableButton( User1, true );   /* start ocr */
    enableButton( User2, false );  /* Cancel    */
    enableButton( Close, true );
}
Exemple #12
0
ErrorMessage::ErrorMessage (QWidget *parent)
	: KDialogBase (parent, "errorDialog", false, 0, KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true, i18n("Help on &Error") )
{
	connect( this, SIGNAL( user1Clicked() ), this, SLOT( showHelpOnError() ) );
	connect( this, SIGNAL( helpClicked() ), this, SLOT( errorMessageHelp() ) );
	setCaption( i18n("Error Dialog") );
	setButtonWhatsThis( KDialogBase::Close, i18n("Closes this error dialog") );
	setButtonWhatsThis( KDialogBase::Help, i18n("Click here to read more on this error dialog in KTurtle's Handbook.") );
	setButtonTip( KDialogBase::Help, i18n("Click here for help using this error dialog") );
	setButtonWhatsThis( KDialogBase::User1, i18n("Click here for help regarding the error you selected in the list. This button will not work when no error is selected.") );
	setButtonTip( KDialogBase::User1, i18n("Click here for help regarding the error you selected.") );
	
	QWidget *baseWidget = new QWidget(this);
	setMainWidget(baseWidget);
	baseLayout = new QVBoxLayout(baseWidget); 
	
	label = new QLabel(baseWidget);
	label->setText( i18n("In this list you find the error(s) that resulted from running your Logo code. \nGood luck!") );
	// \nYou can select an error and click the 'Help on Error' button for help.
	label->setScaledContents(true);
	baseLayout->addWidget(label);
	
	spacer = new QSpacerItem( 10, 10, QSizePolicy::Minimum, QSizePolicy::Fixed );
	baseLayout->addItem(spacer);
	
	errTable = new QTable(0, 3, baseWidget);
	errTable->setSelectionMode(QTable::SingleRow);
	errTable->setReadOnly(true);
	errTable->setShowGrid(false);
	errTable->setFocusStyle(QTable::FollowStyle);
	errTable->setLeftMargin(0);
	
	errTable->horizontalHeader()->setLabel( 0, i18n("number") );
	errTable->hideColumn(0); // needed to link with the errorData which stores the tokens, codes, etc.
	
	errTable->horizontalHeader()->setLabel( 1, i18n("line") );
	errTable->setColumnWidth(1, baseWidget->fontMetrics().width("88888") );
	
	errTable->horizontalHeader()->setLabel( 2, i18n("description") );
	errTable->setColumnStretchable(2, true);

	baseLayout->addWidget(errTable);
	
	// Since both help buttons are not working yet. Doc need a section on the Error Dialog!
	enableButton(KDialogBase::Help, false);
	enableButton(KDialogBase::User1, false);
	
	errCount = 1;
}
Exemple #13
0
/*
 * starts visual ocr process. Depending on the ocr engine, this function creates
 * a new dialog, and shows it.
 */
bool KSANEOCR::startOCRVisible( QWidget *parent )
{
   if( visibleOCRRunning ) return( false );
   bool res = true;

   m_parent = parent;

   if( m_ocrEngine == GOCR )
   {
       m_ocrProcessDia = new KGOCRDialog ( parent, m_spellInitialConfig );
   }
   else if( m_ocrEngine == OCRAD )
   {
       m_ocrProcessDia = new ocradDialog( parent, m_spellInitialConfig );
   }
   else if( m_ocrEngine == KADMOS )
   {
#ifdef HAVE_KADMOS
/*** Kadmos Engine OCR ***/
       m_ocrProcessDia = new KadmosDialog( parent, m_spellInitialConfig );
#else
       KMessageBox::sorry(0, i18n("This version of Kooka was not compiled with KADMOS support.\n"
           "Please select another OCR engine in Kooka's options dialog."));
       kdDebug(28000) << "Sorry, this version of Kooka has no KADMOS support" << endl;
#endif /* HAVE_KADMOS */
   }
   else
   {
      kdDebug(28000) << "ERR Unknown OCR engine requested!" << endl;
   }

   /*
    * this part is independant from the engine again
    */
   if( m_ocrProcessDia )
   {
       m_ocrProcessDia->setupGui();

       m_ocrProcessDia->introduceImage( m_img );
       visibleOCRRunning = true;

      connect( m_ocrProcessDia, SIGNAL( user1Clicked()), this, SLOT( startOCRProcess() ));
      connect( m_ocrProcessDia, SIGNAL( closeClicked()), this, SLOT( slotClose() ));
      connect( m_ocrProcessDia, SIGNAL( user2Clicked()), this, SLOT( slotStopOCR() ));
      m_ocrProcessDia->show();

   }
   return( res );
}
ConvertDialog::ConvertDialog( Project *prj, QWidget *parent, const char* name )
 : KDialogBase( parent, name, true, i18n( "Converting images to text" ), Ok|Cancel|Help|User1,
 		Ok, false, KStdGuiItem::clear() ), project( prj ), sending( false ) {
	// prj mustn't be 0
	if ( !prj ) kdFatal() << "ConvertDialog constructor: prj is null\n";

	QFrame *top = makeMainWidget();
	layoutGeneral = new QVBoxLayout( top, marginGeneral, 6 );

	layoutSub = new QHBoxLayout( layoutGeneral );
    layoutSub->addItem( new QSpacerItem( 40, 20, QSizePolicy::Expanding,
						QSizePolicy::Minimum ) );
    subtitle = new QLabel( top );
    layoutSub->addWidget( subtitle );
    layoutSub->addItem( new QSpacerItem( 40, 20, QSizePolicy::Expanding,
						QSizePolicy::Minimum ) );

	image = new SubtitleView( top );
	image->setAutoCenterEnabled( Config().autoCenter() );
	layoutGeneral->addWidget( image );

    progress = new KProgress( project->numSub(), top );
    layoutGeneral->addWidget( progress );

	text = new QLabel( top );
	text->setAlignment( text->alignment() | Qt::WordBreak );
	text->setText( i18n( "The marked chars were not recognized. Enter correct ASCII char, \"string\" or 4 to 8 digit hex unicode." ) );
	layoutGeneral->addWidget( text );

	line = new KLineEdit( top );
	layoutGeneral->addWidget( line );

	layoutCheckBox = new QHBoxLayout( layoutGeneral );
    layoutCheckBox->addItem( new QSpacerItem( 40, 20, QSizePolicy::Expanding,
						QSizePolicy::Minimum ) );
    checkbox = new QCheckBox( i18n( "Save to database" ), top );
	checkbox->setChecked( true );
    layoutCheckBox->addWidget( checkbox );
    layoutCheckBox->addItem( new QSpacerItem( 40, 20, QSizePolicy::Expanding,
						QSizePolicy::Minimum ) );

	setEnabledWidgetsInput( false );
	enableButton( User1, false );

	connect( this, SIGNAL( user1Clicked() ), line, SLOT( clear() ) );
	connect( line, SIGNAL( textChanged( const QString& ) ),
			this, SLOT( editChanged( const QString& ) ) );
}
NotificationDialog::NotificationDialog( KFileItem medium, NotifierSettings *settings,
                                        TQWidget* parent, const char* name )
	: KDialogBase( parent, name, false, i18n( "Medium Detected" ), Ok|Cancel|User1, Ok, true),
	  m_medium(medium), m_settings( settings )
{
	setCaption( TDEIO::decodeFileName(m_medium.name()) );
	clearWState( WState_Polished );

	TQWidget *page = new TQWidget( this );
	setMainWidget(page);
	TQVBoxLayout *topLayout = new TQVBoxLayout( page, 0, spacingHint() );

	m_view = new NotificationDialogView( page );

	topLayout->addWidget(m_view);
	m_view->iconLabel->setPixmap( m_medium.pixmap(64) );
	m_view->mimetypeLabel->setText( i18n( "<b>Medium type:</b>" ) + " "
	                              + m_medium.mimeTypePtr()->comment() );

	updateActionsListBox();

	resize( TQSize(400,400).expandedTo( minimumSizeHint() ) );


	m_actionWatcher = new KDirWatch();
	TQString services_dir
		= locateLocal( "data", "konqueror/servicemenus", true );
	m_actionWatcher->addDir( services_dir );

	setButtonText( User1, i18n("Configure...") );

	connect( m_actionWatcher, TQT_SIGNAL( dirty( const TQString & ) ),
	         this, TQT_SLOT( slotActionsChanged( const TQString & ) ) );
	connect( this , TQT_SIGNAL( okClicked() ),
	         this, TQT_SLOT( slotOk() ) );
	connect( this, TQT_SIGNAL( user1Clicked() ),
	         this, TQT_SLOT( slotConfigure() ) );
	connect( m_view->actionsList, TQT_SIGNAL( doubleClicked ( TQListBoxItem*, const TQPoint & ) ),
	         this, TQT_SLOT( slotOk() ) );

	connect( this, TQT_SIGNAL( finished() ),
	         this, TQT_SLOT( delayedDestruct() ) );

	m_actionWatcher->startScan();
	TQPushButton * btn = actionButton( Ok );
	btn->setFocus();
}
KonqSessionDlg::KonqSessionDlg( KonqViewManager *manager, QWidget *parent )
    : KDialog( parent )
    , d( new KonqSessionDlgPrivate( manager, this ) )
{
    d->layout()->setMargin( 0 );
    setMainWidget( d );
    
    setObjectName( QLatin1String( "konq_session_dialog" ) );
    setModal( true );
    setCaption( i18nc( "@title:window", "Manage Sessions" ) );
    setButtons( BTN_OPEN | Close );
    setDefaultButton( Close );
    
    setButtonGuiItem( BTN_OPEN, KGuiItem( i18n( "&Open" ), "document-open" ) );
    d->m_pSaveCurrentButton->setIcon(KIcon("document-save"));
    d->m_pRenameButton->setIcon(KIcon("edit-rename"));
    d->m_pDeleteButton->setIcon(KIcon("edit-delete"));
    d->m_pNewButton->setIcon(KIcon("document-new"));
    
    QString dir = KStandardDirs::locateLocal("appdata", "sessions/");
    
    d->m_pModel = new KDirModel(d->m_pListView);
    d->m_pModel->sort(QDir::Name);
    d->m_pModel->dirLister()->setDirOnlyMode(true);
    d->m_pModel->dirLister()->openUrl(dir);
    d->m_pListView->setModel(d->m_pModel);
    
    d->m_pListView->setMinimumSize( d->m_pListView->sizeHint() );
    
    connect( d->m_pListView->selectionModel(), SIGNAL( selectionChanged(
        const QItemSelection  &, const QItemSelection &) ), this, SLOT(
        slotSelectionChanged() ) );
    
    enableButton( BTN_OPEN, d->m_pListView->currentIndex().isValid() );
    slotSelectionChanged();

    d->m_pOpenTabsInsideCurrentWindow->setChecked(
	KonqSettings::openTabsInsideCurrentWindow());

    connect( this,SIGNAL(user1Clicked()),SLOT(slotOpen()));
    connect( d->m_pNewButton, SIGNAL(clicked()),SLOT(slotNew()));
    connect( d->m_pSaveCurrentButton, SIGNAL(clicked()),SLOT(slotSave()));
    connect( d->m_pRenameButton, SIGNAL(clicked()),SLOT(slotRename()));
    connect( d->m_pDeleteButton, SIGNAL(clicked()),SLOT(slotDelete()));
    
    resize( sizeHint() );
}
KSaneDeviceDialog::KSaneDeviceDialog(QWidget *parent)
    : KDialog(parent)
{

    setButtons(KDialog::User1 | KDialog::Ok | KDialog::Cancel);
    setButtonText(User1, i18n("Reload devices list"));
    
    m_btnGroup = new QButtonGroup(this);

    m_btnBox = new QGroupBox;
    QVBoxLayout *layout = new QVBoxLayout;
    m_btnContainer = new QWidget;
    m_btnLayout = new QVBoxLayout(m_btnContainer);
    QScrollArea *area = new QScrollArea;
    
    m_btnBox->setLayout(layout);

    QLabel *explanation =
      new QLabel(i18n("<html>The SANE (Scanner Access Now Easy) system could not find any device.<br>"
                      "Check that the scanner is plugged in and turned on<br>"
                      "or check your systems scanner setup.<br>"
                      "For details about SANE see the "
                      "<a href='http://www.sane-project.org/'>SANE homepage</a>.</html>"));
    explanation->setOpenExternalLinks(true);
    int l,t,r,b;
    layout->getContentsMargins(&l, &t, &r, &b);
    explanation->setContentsMargins(l, t, r, b);

    layout->addWidget(explanation);
    m_btnBox->adjustSize();  // make sure to see the complete explanation text
    layout->addWidget(area);
    layout->setContentsMargins(0,0,0,0);

    area->setWidgetResizable(true);
    area->setFrameShape(QFrame::NoFrame);
    area->setWidget(m_btnContainer);

    setMainWidget(m_btnBox);
    setMinimumHeight(200);
    m_findDevThread = FindSaneDevicesThread::getInstance();

    connect(m_findDevThread, SIGNAL(finished()), this, SLOT(updateDevicesList()));
    connect(this, SIGNAL(user1Clicked()),        this, SLOT(reloadDevicesList()));

    reloadDevicesList();
}
KOEventViewerDialog::KOEventViewerDialog( CalendarSupport::Calendar *calendar, QWidget *parent )
  : KDialog( parent )
{
  setCaption( i18n( "Event Viewer" ) );
  setButtons( Close | User1 | User2 );
  setModal( false );
  setButtonGuiItem( User1, KGuiItem( i18n( "Edit..." ), KIcon( "document-edit" ) ) );
  setButtonGuiItem( User2, KGuiItem( i18n( "Show in Context" ) ) );
  mEventViewer = new CalendarSupport::IncidenceViewer( calendar, this );
  setMainWidget( mEventViewer );

  resize( QSize( 500, 520 ).expandedTo( minimumSizeHint() ) );

  connect( this, SIGNAL(finished()), this, SLOT(delayedDestruct()) );
  connect( this, SIGNAL(user1Clicked()), this, SLOT(editIncidence()) );
  connect( this, SIGNAL(user2Clicked()), this, SLOT(showIncidenceContext()) );
}
Exemple #19
0
// FIXME: The basic structure of this dialog has been copied from KPrefsDialog,
//        because we want custom buttons, a Tabbed dialog, and a different
//        headline... Maybe we should try to achieve the same without code
//        duplication.
ExportWebDialog::ExportWebDialog( HTMLExportSettings *settings, QWidget *parent,
                                  const char *name)
  : KDialogBase( Tabbed,i18n("Export Calendar as Web Page"),Help|Default|User1|Cancel, User1, parent, name, false, false, i18n("Export") ),
    KPrefsWidManager( settings ), mSettings( settings )
{
  setupGeneralPage();
  setupEventPage();
  setupTodoPage();
// Disabled bacause the functionality is not yet implemented.
//  setupJournalPage();
//  setupFreeBusyPage();
//  setupAdvancedPage();

  connect( this, SIGNAL( user1Clicked() ), SLOT( slotOk() ) );
  connect( this, SIGNAL( cancelClicked() ), SLOT( reject() ) );

  readConfig();
}
SloxFolderDialog::SloxFolderDialog( SloxFolderManager *manager, FolderType type, QWidget *parent ) :
  KDialog( parent),
  mManager( manager ),
  mFolderType( type )
{
  setCaption( i18n("Select Folder") );
  setButtons( Ok|Cancel|User1 );
  setDefaultButton( Ok );
  setButtonGuiItem( User1, KGuiItem( i18n("Reload"), "view-refresh" ) );
  mListView = new K3ListView( this );
  mListView->setRootIsDecorated( true );
  mListView->setShowSortIndicator( true );
  mListView->addColumn( i18n("Folder") );
  mListView->addColumn( i18n("Folder ID"), 0 );
  setMainWidget( mListView );
  updateFolderView();
  connect( manager, SIGNAL( foldersUpdated() ), SLOT( updateFolderView() ) );
  connect(this,SIGNAL(user1Clicked()),this,SLOT(slotUser1( )));
}
Exemple #21
0
void KexiDBConnectionDialog::init()
{
	connect( this, SIGNAL(user1Clicked()), this, SLOT(accept()));
	setMainWidget(tabWidget);
	connect(tabWidget->mainWidget, SIGNAL(saveChanges()), this, SIGNAL(saveChanges()));
	connect(tabWidget, SIGNAL(testConnection()), this, SIGNAL(testConnection()));

	adjustSize();
	resize(width(), tabWidget->height());
	if (tabWidget->mainWidget->connectionOnly())
		tabWidget->mainWidget->driversCombo()->setFocus();
	else if (tabWidget->mainWidget->nameCombo->currentText().isEmpty())
		tabWidget->mainWidget->nameCombo->setFocus();
	else if (tabWidget->mainWidget->userEdit->text().isEmpty())
		tabWidget->mainWidget->userEdit->setFocus();
	else if (tabWidget->mainWidget->passwordEdit->text().isEmpty())
		tabWidget->mainWidget->passwordEdit->setFocus();
	else //back
		tabWidget->mainWidget->nameCombo->setFocus();
}
YahooInviteListImpl::YahooInviteListImpl(QWidget *parent) : KDialog(parent)
{
	setButtons( KDialog::Cancel | KDialog::User1 );
	setEscapeButton( KDialog::Cancel );
	setButtonText( KDialog::User1, i18n("Invite") );

	QWidget* w = new QWidget( this );
	m_inviteWidget = new Ui::YahooInviteListBase();
	m_inviteWidget->setupUi( w );
	setMainWidget( w );	
	QObject::connect( this, SIGNAL(user1Clicked()), this, SLOT(slotInvite()) );
	QObject::connect( m_inviteWidget->btn_Add, SIGNAL(clicked()), this, SLOT(slotAdd()) );
	QObject::connect( m_inviteWidget->btn_Remove, SIGNAL(clicked()), this, SLOT(slotRemove()) );
	QObject::connect( m_inviteWidget->btnCustomAdd, SIGNAL(clicked()), this, SLOT(slotAddCustom()) );
        connect(this,SIGNAL(cancelClicked()),this,SLOT(slotCancel()));
	m_inviteWidget->listFriends->setSelectionMode( QAbstractItemView::ExtendedSelection );
	m_inviteWidget->listInvited->setSelectionMode( QAbstractItemView::ExtendedSelection );

	show();
}
Exemple #23
0
CalDialog::CalDialog(QWidget *parent, JoyDevice *joy)
  : KDialog( parent ),
    joydev(joy)
{
  setObjectName( "calibrateDialog" );
  setModal( true );
  setCaption( i18n("Calibration") );
  setButtons( Cancel | User1 );
  setDefaultButton( User1 );
  setButtonGuiItem( User1, KGuiItem( i18n("Next") ) );
  showButtonSeparator( true );

  KVBox *main = new KVBox( this );
  setMainWidget( main );

  text = new QLabel(main);
  text->setMinimumHeight(200);
  valueLbl = new QLabel(main);
  connect(this,SIGNAL(user1Clicked()),this,SLOT(slotUser1()));
}
DistributionListDialog::DistributionListDialog( QWidget *parent )
  : KDialog( parent )
{
  QFrame *topFrame = new QFrame( this );
  setMainWidget( topFrame );
  setCaption( i18nc("@title:window", "Save Distribution List") );
  setButtons( User1 | Cancel );
  setDefaultButton( User1 );
  setModal( false );
  setButtonText( User1, i18nc("@action:button","Save List") );
  enableButton( User1, false );

  QBoxLayout *topLayout = new QVBoxLayout( topFrame );
  topLayout->setSpacing( spacingHint() );

  QBoxLayout *titleLayout = new QHBoxLayout();
  titleLayout->setSpacing( spacingHint() );
  topLayout->addItem( titleLayout );

  QLabel *label = new QLabel(
    i18nc("@label:textbox Name of the distribution list.", "&Name:"), topFrame );
  titleLayout->addWidget( label );

  mTitleEdit = new KLineEdit( topFrame );
  titleLayout->addWidget( mTitleEdit );
  mTitleEdit->setFocus();
  mTitleEdit->setClearButtonShown( true );
  label->setBuddy( mTitleEdit );

  mRecipientsList = new QTreeWidget( topFrame );
  mRecipientsList->setHeaderLabels(
                     QStringList() << i18nc( "@title:column Name of the recipient","Name" )
                                   << i18nc( "@title:column Email of the recipient", "Email" )
                                  );
  mRecipientsList->setRootIsDecorated( false );
  topLayout->addWidget( mRecipientsList );
  connect( this, SIGNAL( user1Clicked() ),
           this, SLOT( slotUser1() ) );
  connect( mTitleEdit, SIGNAL( textChanged( const QString& ) ),
           this, SLOT( slotTitleChanged( const QString& ) ) );
}
KonqProfileDlg::KonqProfileDlg( KonqViewManager *manager, const QString & preselectProfile, QWidget *parent )
: KDialog( parent )
, d( new KonqProfileDlgPrivate( manager, this ) )
{
  d->layout()->setMargin( 0 );
  setMainWidget( d );

  setObjectName( QLatin1String( "konq_profile_dialog" ) );
  setModal( true );
  setCaption( i18nc( "@title:window", "Profile Management" ) );
  setButtons( Close | BTN_RENAME | BTN_DELETE | BTN_SAVE );
  setDefaultButton( BTN_SAVE );
  setButtonGuiItem( BTN_RENAME, KGuiItem( i18n( "&Rename Profile" ) ) );
  setButtonGuiItem( BTN_DELETE, KGuiItem( i18n( "&Delete Profile" ), "edit-delete" ) );
  setButtonGuiItem( BTN_SAVE, KStandardGuiItem::save() );

  d->m_pProfileNameLineEdit->setFocus();

  connect( d->m_pListView, SIGNAL(itemChanged(QListWidgetItem*)),
            SLOT(slotItemRenamed(QListWidgetItem*)) );

  loadAllProfiles( preselectProfile );
  d->m_pListView->setMinimumSize( d->m_pListView->sizeHint() );

  d->m_cbSaveURLs->setChecked( KonqSettings::saveURLInProfile() );

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

  connect( d->m_pProfileNameLineEdit, SIGNAL(textChanged(QString)),
           this, SLOT(slotTextChanged(QString)) );

  enableButton( BTN_RENAME, d->m_pListView->currentItem() != 0 );
  enableButton( BTN_DELETE, d->m_pListView->currentItem() != 0 );

  connect( this,SIGNAL(user1Clicked()),SLOT(slotRenameProfile()));
  connect( this,SIGNAL(user2Clicked()),SLOT(slotDeleteProfile()));
  connect( this,SIGNAL(user3Clicked()),SLOT(slotSave()));

  resize( sizeHint() );
}
Exemple #26
0
DiagnosticDialog::DiagnosticDialog( const KAboutData *aboutData, QWidget *parent )
        : KDialog( parent )
{
    if( aboutData == 0 )
        aboutData = KGlobal::mainComponent().aboutData();

    m_textBox = new QPlainTextEdit( generateReport( aboutData ), this );

    setPlainCaption( i18nc( "%1 is the program name", "%1 Diagnostics", aboutData->programName() ) );

    setButtons( Close | User1 );
    setButtonText( User1, i18n( "Copy to Clipboard" ) );

    m_textBox->setReadOnly( true );

    setMainWidget( m_textBox );
    setInitialSize( QSize( 480, 460 ) );

    connect( this, SIGNAL(user1Clicked()), SLOT(slotCopyToClipboard()) );
    connect( this, SIGNAL(finished()), SLOT(deleteLater()) );
}
void ImageViewer::init(QString caption, QString capText) {
    setAttribute( Qt::WA_DeleteOnClose, true );
    setModal( false );
    setCaption( i18n( "KStars image viewer" ) + QString( " : " ) + caption );
    setButtons( KDialog::Close | KDialog::User1);

    // FIXME: Add more options, and do this more nicely
    KGuiItem invertButton( i18n("Invert colors"), "", i18n("Reverse colors of the image. This is useful to enhance contrast at times. This affects only the display and not the saving.") );
    setButtonGuiItem( KDialog::User1, invertButton );
    connect( this, SIGNAL( user1Clicked() ), this, SLOT ( invertColors() ) );


    // Create widget
    QFrame* page = new QFrame( this );
    setMainWidget( page );
    m_View = new ImageLabel( page );
    m_View->setAutoFillBackground( true );
    m_Caption = new QLabel( page );
    m_Caption->setAutoFillBackground( true );
    m_Caption->setFrameShape( QFrame::StyledPanel );
    m_Caption->setText( capText );
    // Add layout
    QVBoxLayout* vlay = new QVBoxLayout( page );
    vlay->setSpacing( 0 );
    vlay->setMargin( 0 );
    vlay->addWidget( m_View );
    vlay->addWidget( m_Caption );

    //Reverse colors
    QPalette p = palette();
    p.setColor( QPalette::Window, palette().color( QPalette::WindowText ) );
    p.setColor( QPalette::WindowText, palette().color( QPalette::Window ) );
    m_Caption->setPalette( p );
    m_View->setPalette( p );
    
    //If the caption is wider than the image, try to shrink the font a bit
    QFont capFont = m_Caption->font();
    capFont.setPointSize( capFont.pointSize() - 2 );
    m_Caption->setFont( capFont );
}
Exemple #28
0
void TESession::startZModem(const TQString &zmodem, const TQString &dir, const TQStringList &list)
{
  zmodemBusy = true;
  zmodemProc = new KProcIO;

  (*zmodemProc) << zmodem << "-v";
  for(TQStringList::ConstIterator it = list.begin();
      it != list.end();
      ++it)
  {
     (*zmodemProc) << (*it);
  }

  if (!dir.isEmpty())
     zmodemProc->setWorkingDirectory(dir);
  zmodemProc->start(KProcIO::NotifyOnExit, false);

  // Override the read-processing of KProcIO
  disconnect(zmodemProc,TQT_SIGNAL (receivedStdout (TDEProcess *, char *, int)), 0, 0);
  connect(zmodemProc,TQT_SIGNAL (receivedStdout (TDEProcess *, char *, int)),
          this, TQT_SLOT(zmodemSendBlock(TDEProcess *, char *, int)));
  connect(zmodemProc,TQT_SIGNAL (receivedStderr (TDEProcess *, char *, int)),
          this, TQT_SLOT(zmodemStatus(TDEProcess *, char *, int)));
  connect(zmodemProc,TQT_SIGNAL (processExited(TDEProcess *)),
          this, TQT_SLOT(zmodemDone()));

  disconnect( sh,TQT_SIGNAL(block_in(const char*,int)), this, TQT_SLOT(onRcvBlock(const char*,int)) );
  connect( sh,TQT_SIGNAL(block_in(const char*,int)), this, TQT_SLOT(zmodemRcvBlock(const char*,int)) );
  connect( sh,TQT_SIGNAL(buffer_empty()), this, TQT_SLOT(zmodemContinue()));

  zmodemProgress = new ZModemDialog(te->topLevelWidget(), false,
                                    i18n("ZModem Progress"));

  connect(zmodemProgress, TQT_SIGNAL(user1Clicked()),
          this, TQT_SLOT(zmodemDone()));

  zmodemProgress->show();
}
CDDBDlg::CDDBDlg( QWidget* parent, const char* name )
    : KDialogBase( parent, name, false, i18n( "CD Editor" ),
      Ok|Cancel|User1|User2, Ok, true )
{
  KGlobal::locale()->insertCatalogue("libkcddb");

  m_dlgBase = new CDInfoDialogBase( this, "m_dlgBase" );

  setMainWidget( m_dlgBase );

  setButtonText( User1, i18n( "Upload" ) );
  setButtonText( User2, i18n( "Fetch Info" ) );

  connect( this, SIGNAL( okClicked() ), SLOT( save() ) );
  connect( this, SIGNAL( user1Clicked() ), SLOT( upload() ) );
  connect( this, SIGNAL( user2Clicked() ), SIGNAL( cddbQuery() ) );
  connect( m_dlgBase, SIGNAL( play( int ) ), SIGNAL( play( int ) ) );

  cddbClient = new KCDDB::Client();
  cddbClient->setBlockingMode(false);
  connect (cddbClient, SIGNAL(finished(CDDB::Result)),
                       SLOT(submitFinished(CDDB::Result)));
}
KNGroupDialog::KNGroupDialog( QWidget *parent, KNNntpAccount::Ptr a ) :
  KNGroupBrowser(parent, i18n("Subscribe to Newsgroups"),a, User1 | User2, true, i18n("New &List"), i18n("New &Groups...") )
{
  rightLabel->setText(i18n("Current changes:"));
  subView=new Q3ListView(page);
  subView->addColumn(i18n("Subscribe To"));
  unsubView=new Q3ListView(page);
  unsubView->addColumn(i18n("Unsubscribe From"));

  QVBoxLayout *protL=new QVBoxLayout();
  protL->setSpacing(3);
  listL->addLayout(protL, 1,2);
  protL->addWidget(subView);
  protL->addWidget(unsubView);

  dir1=right;
  dir2=left;

  connect(groupView, SIGNAL(selectionChanged(Q3ListViewItem*)),
    this, SLOT(slotItemSelected(Q3ListViewItem*)));
  connect(groupView, SIGNAL(selectionChanged()),
    this, SLOT(slotSelectionChanged()));
  connect(subView, SIGNAL(selectionChanged(Q3ListViewItem*)),
    this, SLOT(slotItemSelected(Q3ListViewItem*)));
  connect(unsubView, SIGNAL(selectionChanged(Q3ListViewItem*)),
    this, SLOT(slotItemSelected(Q3ListViewItem*)));

  connect(arrowBtn1, SIGNAL(clicked()), this, SLOT(slotArrowBtn1()));
  connect(arrowBtn2, SIGNAL(clicked()), this, SLOT(slotArrowBtn2()));

  connect( this, SIGNAL(user1Clicked()), SLOT(slotUser1()) );
  connect( this, SIGNAL(user2Clicked()), SLOT(slotUser2()) );

  KNHelper::restoreWindowSize("groupDlg", this, QSize(662,393));  // optimized for 800x600

  setHelp("anc-fetch-group-list");
}