void SvCreator::addEvents(void)
{
  connect(m_subMenus["NewFile"],SIGNAL(triggered(bool)),this,SLOT(newView()));
  connect(m_subMenus["NewNode"],SIGNAL(triggered(bool)),this,SLOT(newNode()));
  connect(m_subMenus["CopySelected"],SIGNAL(triggered(bool)),this,SLOT(copySelected()));
  connect(m_subMenus["PasteFromSelected"],SIGNAL(triggered(bool)),this,SLOT(pasteFromSelected()));
  connect(m_subMenus["DeleteNode"],SIGNAL(triggered(bool)),this,SLOT(deleteNode()));
  connect(m_subMenus["Open"],SIGNAL(triggered(bool)),this,SLOT(open()));
  connect(m_subMenus["Save"],SIGNAL(triggered(bool)),this,SLOT(save()));
  connect(m_subMenus["SaveAs"], SIGNAL(triggered(bool)), this, SLOT(saveAs()));
  connect(m_subMenus["ImportHostGroupAsBusinessView"],SIGNAL(triggered(bool)),this,SLOT(handleImportHostGroupAsBusinessView()));
  connect(m_subMenus["ImportMonitorItemsAsDataPoints"],SIGNAL(triggered(bool)),this,SLOT(handleImportMonitorItemsAsDataPoints()));
  connect(m_subMenus["ImportNagiosChecks"],SIGNAL(triggered(bool)),this,SLOT(importNagiosChecks()));
  connect(m_subMenus["ImportNagiosBPIConf"],SIGNAL(triggered(bool)),this,SLOT(handleImportNagiosBPIConfigAsBusinessView()));
  connect(m_subMenus["ImportZabbixITServices"],SIGNAL(triggered(bool)),this,SLOT(handleImportZabbixITServicesAsBusinessView()));
  connect(m_subMenus["Quit"],SIGNAL(triggered(bool)),this,SLOT(treatCloseAction()));
  connect(m_subMenus["ShowAbout"],SIGNAL(triggered(bool)),this,SLOT(handleShowAbout()));
  connect(m_subMenus["ShowOnlineResources"],SIGNAL(triggered(bool)),this,SLOT(handleShowOnlineResources()));
  connect(m_editor,SIGNAL(saveClicked()),this,SLOT(save()));
  connect(m_editor,SIGNAL(closeClicked()),this,SLOT(treatCloseAction()));
  connect(m_editor,SIGNAL(returnPressed()),this,SLOT(handleReturnPressed()));
  connect(m_editor,SIGNAL(nodeTypeActivated(qint32)),this,SLOT(handleNodeTypeActivated(qint32)));
  connect(m_editor,SIGNAL(errorOccurred(QString)),this, SLOT(handleErrorOccurred(QString)));
  connect(m_tree,SIGNAL(itemSelectionChanged()),this,SLOT(handleSelectedNodeChanged()));
  connect(m_tree,SIGNAL(treeNodeMoved(QString)),this,SLOT(handleTreeNodeMoved(QString)));
}
Example #2
0
TtbDialog::TtbDialog(Context *context, RideItem *item) :
    context(context),
    ride( item ),
    proMember( false )
{
    exerciseId = ride->ride()->getTag("TtbExercise", "");

    setWindowTitle("Trainingstagebuch");
    QVBoxLayout *mainLayout = new QVBoxLayout(this);

    QVBoxLayout *progressLayout = new QVBoxLayout;
    progressLabel = new QLabel("", this);
    progressBar = new QProgressBar(this);
    progressLayout->addWidget(progressBar);
    progressLayout->addWidget(progressLabel);

    QHBoxLayout *buttonLayout = new QHBoxLayout;

    closeButton = new QPushButton(tr("&Cancel"), this);
    buttonLayout->addStretch();
    buttonLayout->addWidget(closeButton);

    mainLayout->addLayout(progressLayout);
    mainLayout->addLayout(buttonLayout);

    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));
    connect(&networkMgr, SIGNAL(finished(QNetworkReply*)), this,
        SLOT(dispatchReply(QNetworkReply*)));

    show();

    uploadToTtb();
}
Example #3
0
void ControlStrip::mousePressEvent(QMouseEvent *event)
{
    int h = height();
    int spacing = qMin(h, (width() - h * 4) / 3);
    int x = event->pos().x();

    if (x < h) {
        emit menuClicked();
        event->accept();
        return;
    }

    if (x > width() - h) {
        emit closeClicked();
        event->accept();
        return;
    }

    if ((x < width() - (h + spacing)) && (x > width() - (h * 2 + spacing))) {
        emit forwardClicked();
        event->accept();
        return;
    }

    if ((x < width() - (h * 2 + spacing * 2)) && (x > width() - (h * 3 + spacing * 2))) {
        emit backClicked();
        event->accept();
        return;
    }
}
Example #4
0
/**
 * 处理内容:窗体控件的创建
 * @param void
 * @return void
 */
void MainWnd::createWidget()
{
    // 创建标题栏
    m_pTitleBar = new TitleBar(this);
    connect(m_pTitleBar,SIGNAL(menuClicked()),SLOT(showMenu()));
    connect(m_pTitleBar,SIGNAL(minClicked()),SLOT(showMin()));
    connect(m_pTitleBar,SIGNAL(maxClicked()),SLOT(showMax()));
    connect(m_pTitleBar,SIGNAL(closeClicked()),SLOT(showClose()));

    // 创建对工具栏
    m_pToolBar = new ToolBar(this);

    // 创建内容区域
    m_pContentWidget = new Html5Viewer(this);
    m_pContentWidget->setOrientation(Html5Viewer::ScreenOrientationAuto);

    //m_pContentWidget->showExpanded();
    //m_pContentWidget->loadFile(QLatin1String("QtStyleSheetsReference.html"));

    QString strURL = SysSettings::Instance()->value(QString::fromLocal8Bit("url/turl"),QVariant()).toString();
    m_pContentWidget->loadUrl(QUrl(strURL));

    // 创建状态栏
    m_pStatuBar = new StatusBar(this);

//    // 右键菜单
//    connect(this,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(menuRight(const QPoint&)));
}
Example #5
0
void BrowserView::initialize()
{
    connect(m_zoomStrip, SIGNAL(zoomInClicked()), SLOT(zoomIn()));
    connect(m_zoomStrip, SIGNAL(zoomOutClicked()), SLOT(zoomOut()));

    connect(m_controlStrip, SIGNAL(menuClicked()), SIGNAL(menuButtonClicked()));
    connect(m_controlStrip, SIGNAL(backClicked()), m_webView, SLOT(back()));
    connect(m_controlStrip, SIGNAL(forwardClicked()), m_webView, SLOT(forward()));
    connect(m_controlStrip, SIGNAL(closeClicked()), qApp, SLOT(quit()));

    QPalette pal = m_webView->palette();
    pal.setBrush(QPalette::Base, Qt::white);
    m_webView->setPalette(pal);

    FlickCharm *flickCharm = new FlickCharm(this);
    flickCharm->activateOn(m_webView);

    m_webView->setZoomFactor(static_cast<qreal>(m_currentZoom)/100.0);
    connect(m_webView, SIGNAL(loadStarted()), SLOT(start()));
    connect(m_webView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
    connect(m_webView, SIGNAL(loadFinished(bool)), SLOT(finish(bool)));
    connect(m_webView, SIGNAL(urlChanged(QUrl)), SLOT(updateTitleBar()));

    m_webView->setHtml("about:blank");
    m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    m_webView->setFocus();
}
Example #6
0
WPUserInfo::WPUserInfo( WPContact *contact, QWidget *parent )
	: KDialog( parent ), m_contact(contact),
	  Comment(i18n("N/A")), Workgroup(i18n("N/A")), OS(i18n("N/A")), Software(i18n("N/A"))
{
	setButtons( KDialog::Close );
	setDefaultButton(KDialog::Close);
//	kDebug( 14170 ) ;

	setCaption( i18n( "User Info for %1", m_contact->nickName() ) );

	QWidget* w = new QWidget( this );
	m_mainWidget = new Ui::WPUserInfoWidget();
	m_mainWidget->setupUi( w );
	setMainWidget( w );

	m_mainWidget->sComputerName->setText( m_contact->contactId() );

//	m_mainWidget->sComment->setText(i18n("Looking"));
//	m_mainWidget->sWorkgroup->setText(i18n("Looking"));
//	m_mainWidget->sOS->setText(i18n("Looking"));
//	m_mainWidget->sServer->setText(i18n("Looking"));

	connect( this, SIGNAL(closeClicked()), this, SLOT(slotCloseClicked()) );

	noComment = true;
	startDetailsProcess(m_contact->contactId());
}
DHeaderWidget::DHeaderWidget(QWidget *parent) :
    QWidget(parent)
{
    QHBoxLayout *btlayout = new QHBoxLayout();
    m_CloseButton = new DCloseButton();
    connect(m_CloseButton, SIGNAL(clicked()), this, SIGNAL(closeClicked()));
    btlayout->setMargin(0);
    btlayout->addWidget(m_CloseButton);
    btlayout->setAlignment(m_CloseButton, Qt::AlignRight);

    QHBoxLayout *logolayout = new QHBoxLayout();
    QLabel *logolabel = new QLabel();
    logolabel->setPixmap(QPixmap(":/fontend/images/logo.png"));
    logolayout->addStretch();
    logolayout->addWidget(logolabel);
    logolayout->setAlignment(logolabel, Qt::AlignBottom);
    QLabel *versionlabel = new QLabel(QString("<a style='color:white; font-size:11px;'>%1</a>").arg(DeepinInstaller::Version));
    versionlabel->setIndent(2);
    logolayout->addSpacing(2);
    logolayout->addWidget(versionlabel);
    logolayout->setAlignment(versionlabel, Qt::AlignBottom);
    logolayout->addStretch();

    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addLayout(btlayout);
    layout->addLayout(logolayout);
    this->setLayout(layout);
    this->setFixedHeight(80);
}
RocketFtpDialog::RocketFtpDialog(RocketImageList *list, QWidget *parent) : QDialog(parent) {
    images = list;
    setupUi(this);
    statusBar = new QStatusBar(this);
    statusBar->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    statusBar->setSizeGripEnabled(false);
    progressBar = new QProgressBar(statusBar);
    progressBar->setTextVisible(false);
    new QHBoxLayout(progressBar);
    progressBar->layout()->setMargin(0);
    statusLabel = new QLabel("Ready.", progressBar);
    statusLabel->setAlignment(Qt::AlignLeft|Qt::AlignVCenter);
    progressBar->layout()->addItem(new QSpacerItem(5, 5));
    progressBar->layout()->addWidget(statusLabel);
    statusBar->addWidget(progressBar, 1);
    layout()->addWidget(statusBar);
    connect(btnUpload, SIGNAL(clicked()), SLOT(uploadClicked()));
    connect(btnClose, SIGNAL(clicked()), SLOT(closeClicked()));
    connect(btnBrowse, SIGNAL(clicked()), SLOT(browseClicked()));
    linPort->setValidator(new QIntValidator(0, 65535, linPort));
    
    QSettings settings;
    settings.beginGroup("ftp");
    linAddress->setText(settings.value("address", "").toString());
    linPort->setText(settings.value("port", "21").toString());
    linUsername->setText(settings.value("username", "").toString());
    linPassword->setText(settings.value("password", "").toString());
    linLocation->setText(settings.value("location", "").toString());
}
Example #9
0
RateCenterManager::RateCenterManager
(
	QWidget* parent,
	const char* name
) : TAAWidget(parent)
{
    setCaption( "Rate Center Manager" );

    rcList = new Q3ListView(this, "Rate Center Manager");
    rcList->setAllColumnsShowFocus(true);
    rcList->setRootIsDecorated(true);
    rcList->addColumn("Country/State/City");
    rcList->addColumn("Active");
    rcList->addColumn("Avail");
    rcList->addColumn("Total");
    connect(rcList, SIGNAL(doubleClicked(Q3ListViewItem *)), this, SLOT(itemDoubleClicked(Q3ListViewItem *)));

    activeColumn    = 1;
    availColumn     = 2;
    totalColumn     = 3;
    idColumn        = 4;

    rcList->setColumnAlignment(activeColumn, Qt::AlignRight);
    rcList->setColumnAlignment(availColumn,  Qt::AlignRight);
    rcList->setColumnAlignment(totalColumn,  Qt::AlignRight);


    addButton = new QPushButton(this, "Add Button");
    addButton->setText("&Add");
    connect(addButton, SIGNAL(clicked()), this, SLOT(addClicked()));

    editButton = new QPushButton(this, "Edit Button");
    editButton->setText("&Edit");
    connect(editButton, SIGNAL(clicked()), this, SLOT(editClicked()));

    deleteButton = new QPushButton(this, "Delete Button");
    deleteButton->setText("&Delete");
    connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteClicked()));
    deleteButton->setEnabled(false);

    closeButton = new QPushButton(this, "Close Button");
    closeButton->setText("&Close");
    connect(closeButton, SIGNAL(clicked()), this, SLOT(closeClicked()));

    Q3BoxLayout  *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3, 3);
    ml->addWidget(rcList, 1);

    
    Q3BoxLayout  *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 1);
    bl->addStretch(1);
    bl->addWidget(addButton, 0);
    bl->addWidget(editButton, 0);
    bl->addWidget(deleteButton, 0);
    bl->addWidget(closeButton, 0);

    ml->addLayout(bl, 0);

    refreshRateCenters();
}
Example #10
0
void ImportMidiPanel::hidePanel()
      {
      if (isVisible()) {
            setVisible(false);
            emit closeClicked();
            prefferedVisible_ = false;
            }
      }
Example #11
0
void MainWindow::closeEvent(QCloseEvent *event)
{
  event->ignore();

  writeSettings();

  emit closeClicked();
}
Example #12
0
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);
}
ossimQtAboutDialogBase::ossimQtAboutDialogBase(QWidget* parent,
                                               const char* name,
                                               bool modal,
                                               WFlags f)
   : QDialog( parent, name, modal, (f|WDestructiveClose) ),
     theParent(parent),
     theMainVBox(NULL),
     theHBox1(NULL),
     theHBox2(NULL),
     theHBox3(NULL),
     theCloseButton(NULL)
{
   setCaption("About OSSIM");

   // Main vertical box.
   theMainVBox = new QVBoxLayout(this);

   // First row, holds the pixmap.
   theHBox1 = new QHBoxLayout(theMainVBox);
   
   // Second row, holds the text.
   theHBox2 = new QHBoxLayout(theMainVBox);

   // Third row, holds the close button.
   theHBox3 = new QHBoxLayout(theMainVBox);

   QSpacerItem* leftSpacer = new QSpacerItem( 10,
                                              10,
                                              QSizePolicy::Expanding,
                                              QSizePolicy::Minimum );

   theHBox3->addItem(leftSpacer);
   
   theCloseButton = new QPushButton( this, "theCloseButton" );
   theCloseButton->setText( "Close" );
   theCloseButton->setDefault(false);
   theCloseButton->setAutoDefault(false);   
   theHBox3->addWidget(theCloseButton);

   QSpacerItem* rightSpacer = new QSpacerItem( 10,
                                               10,
                                               QSizePolicy::Expanding,
                                               QSizePolicy::Minimum );
   
   theHBox3->addItem(rightSpacer);
   
   //---
   // Connect all the signals to slots...
   //
   // NOTE:
   // If a push button is set to "default" or "auto default" it will always
   // call that slot when return is pressed in the dialog.
   // Since this isn't what I want, all defaults are set to off!
   //---
   connect( theCloseButton, SIGNAL ( clicked() ),
            this, SLOT ( closeClicked() ) );
}
Example #14
0
CoverManager::CoverManager( QWidget *parent )
        : KDialog( parent )
        , m_currentView( AllAlbums )
        , m_timer( new QTimer( this ) )    //search filter timer
        , m_fetchingCovers( false )
        , m_coversFetched( 0 )
        , m_coverErrors( 0 )
        , m_isLoadingCancelled( false )
{
    DEBUG_BLOCK

    setObjectName( "TheCoverManager" );

    s_instance = this;

    // Sets caption and icon correctly (needed e.g. for GNOME)
    kapp->setTopWidget( this );
    setButtons( 0 );
    setCaption( i18n("Cover Manager") );
    setAttribute( Qt::WA_DeleteOnClose );

    connect( this, SIGNAL(hidden()), SLOT(delayedDestruct()) );
    connect( this, SIGNAL(closeClicked()), SLOT(delayedDestruct()) );

    m_splitter = new QSplitter( this );
    setMainWidget( m_splitter );

    //artist listview
    m_artistView = new QTreeWidget( m_splitter );
    m_artistView->setHeaderLabel( i18n( "Albums By" ) );
    m_artistView->setSortingEnabled( false );
    m_artistView->setTextElideMode( Qt::ElideRight );
    m_artistView->setMinimumWidth( 200 );
    m_artistView->setColumnCount( 1 );
    m_artistView->setAlternatingRowColors( true );
    m_artistView->setUniformRowHeights( true );
    m_artistView->setSelectionMode( QAbstractItemView::ExtendedSelection );

    ArtistItem *item = 0;
    item = new ArtistItem( i18n( "All Artists" ) );
    item->setIcon(0, SmallIcon( "media-optical-audio-amarok" ) );
    m_items.append( item );

    Collections::Collection *coll = CollectionManager::instance()->primaryCollection();
    Collections::QueryMaker *qm = coll->queryMaker();
    qm->setAutoDelete( true );
    qm->setQueryType( Collections::QueryMaker::Artist );
    qm->setAlbumQueryMode( Collections::QueryMaker::OnlyNormalAlbums );
    qm->orderBy( Meta::valArtist );

    connect( qm, SIGNAL(newResultReady(Meta::ArtistList)),
             this, SLOT(slotArtistQueryResult(Meta::ArtistList)) );

    connect( qm, SIGNAL(queryDone()), this, SLOT(slotContinueConstruction()) );

    qm->run();
}
void
StravaUploader::upload()
{
    // OAuth no more login
    token = appsettings->cvalue(context->athlete->cyclist, GC_STRAVA_TOKEN, "").toString();
    if (token=="")
    {
        QMessageBox aMsgBox;
        aMsgBox.setText(tr("Cannot login to Strava. Check permission"));
        aMsgBox.exec();
        return;
    }

    // already shared ?
    if(stravaUploadId.length()>0)
    {
        overwrite = false;

        dialog = new QDialog();
        QVBoxLayout *layout = new QVBoxLayout;

        QVBoxLayout *layoutLabel = new QVBoxLayout();
        QLabel *label = new QLabel();
        label->setText(tr("This Ride is marked as already on Strava. Are you sure you want to upload it?"));
        layoutLabel->addWidget(label);

        QPushButton *ok = new QPushButton(tr("OK"), dialog);
        QPushButton *cancel = new QPushButton(tr("Cancel"), dialog);
        QHBoxLayout *buttons = new QHBoxLayout();
        buttons->addStretch();
        buttons->addWidget(cancel);
        buttons->addWidget(ok);

        connect(ok, SIGNAL(clicked()), this, SLOT(okClicked()));
        connect(cancel, SIGNAL(clicked()), this, SLOT(closeClicked()));

        layout->addLayout(layoutLabel);
        layout->addLayout(buttons);

        dialog->setLayout(layout);

        if (!dialog->exec()) return;
    }

    requestUploadStrava();

    if(!uploadSuccessful)
    {
        parent->progressLabel->setText("Error uploading to Strava");
    }
    else
    {
        //requestVerifyUpload();
        parent->progressLabel->setText(tr("Successfully uploaded to Strava\n"));
    }
}
void RemoveRedEyesWindow::setBusy(bool busy)
{
    d->busy = busy;

    if (busy)
    {
        // disable connection to make sure that the "test run" and "correct photos"
        // buttons are not enabled again on ImageListChange
        disconnect(d->imageList, SIGNAL(signalImageListChanged()),
                   this, SLOT(imageListChanged()));

        disconnect(this, SIGNAL(myCloseClicked()),
                   this, SLOT(closeClicked()));

        setButtonGuiItem(Close, KStandardGuiItem::cancel());
        enableButton(User1, false); // correction button
        enableButton(User2, false); // testrun button

        connect(this, SIGNAL(myCloseClicked()),
                this, SLOT(cancelCorrection()));

        d->settingsTab->setEnabled(false);
    }
    else
    {
        // enable connection again to make sure that an empty image list will
        // disable the "test run" and "correct photos" buttons
        connect(d->imageList, SIGNAL(signalImageListChanged()),
                this, SLOT(imageListChanged()));

        disconnect(this, SIGNAL(myCloseClicked()),
                   this, SLOT(cancelCorrection()));

        setButtonGuiItem(Close, KStandardGuiItem::close());
        enableButton(User1, true);  // correction button
        enableButton(User2, true);  // testrun button

        connect(this, SIGNAL(myCloseClicked()),
                this, SLOT(closeClicked()));

        d->settingsTab->setEnabled(true);
    }
}
void RemoveRedEyesWindow::showSummary()
{
    QString message = i18np("<p>%1 image has been successfully processed.</p>",
                            "<p>%1 images have been successfully processed.</p>",
                            processedImages());
    message.append(i18n("<h2>Correction Complete</h2>"));

    KMessageBox::information(this, message, i18n("Correction Complete"));
    closeClicked();
}
void EditorToolBar::closeEditor()
{
    IEditor *current = EditorManager::currentEditor();
    if (!current)
        return;

    if (d->m_isStandalone)
        EditorManager::instance()->closeEditor(current);
    emit closeClicked();
}
void ContactWidgetItem::editContact()
{
    Akonadi::ContactEditorDialog * dialog = new Akonadi::ContactEditorDialog(Akonadi::ContactEditorDialog::EditMode);

    dialog->setContact(m_item);

    connect(dialog, SIGNAL(closeClicked()), dialog, SLOT(delayedDestruct()));
    connect(dialog, SIGNAL(okClicked()), dialog, SLOT(delayedDestruct()));
    connect(dialog, SIGNAL(cancelClicked()), dialog, SLOT(delayedDestruct()));

    dialog->show();
}
Example #20
0
TermWidget::TermWidget(QWidget * par,bool bIsStandalone)
    : QFrame(par)
{
    setObjectName("term_widget");
    if(bIsStandalone)g_pTermWidgetList->append(this);
    m_bIsStandalone = bIsStandalone;

    m_pKonsolePart = 0;
    m_pKonsoleWidget = 0;

    if(bIsStandalone)
    {
        m_pHBox = new KviTalHBox(this);
        m_pTitleLabel = new QLabel(__tr2qs("Terminal Emulator"),m_pHBox);
        m_pTitleLabel->setFrameStyle(QFrame::Raised | QFrame::StyledPanel);
        m_pCloseButton = new QPushButton("",m_pHBox);
        m_pCloseButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Close)));
        m_pCloseButton->setToolTip(__tr2qs("Close this window"));
        m_pHBox->setStretchFactor(m_pTitleLabel,2);
        connect(m_pCloseButton,SIGNAL(clicked()),this,SLOT(closeClicked()));
    } else {
        m_pHBox = 0;
        m_pTitleLabel = 0;
        m_pCloseButton = 0;
    }

    setFrameStyle(QFrame::Sunken | QFrame::Panel);

    KPluginFactory *pKonsoleFactory = KPluginLoader("libkonsolepart").factory();

    if(pKonsoleFactory)
    {
        m_pKonsolePart = static_cast<KParts::ReadOnlyPart *>(pKonsoleFactory->create<QObject>(this, this));

        if(m_pKonsolePart)
        {
            // start the terminal
            qobject_cast<TerminalInterface*>(m_pKonsolePart)->showShellInDir( QString() );

            m_pKonsoleWidget = m_pKonsolePart->widget();

            setFocusProxy(m_pKonsoleWidget);
            m_pKonsoleWidget->show();

            connect ( m_pKonsolePart, SIGNAL(destroyed()), this, SLOT(konsoleDestroyed()) );
        } else {
            m_pKonsoleWidget = new QLabel(__tr2qs("Can't create the terminal emulation part"), this);
        }
    } else {
        m_pKonsoleWidget = new QLabel(__tr2qs("Can't retrieve the terminal emulation factory"), this);
    }
}
Example #21
0
void EditorToolBar::closeEditor()
{
    if (!currentEditor())
        return;

    if (d->m_isStandalone) {
        EditorManager *em = ICore::instance()->editorManager();
        if (IEditor *editor = currentEditor()) {
            em->closeEditor(editor);
        }
    }
    emit closeClicked();
}
Example #22
0
void keyServer::slotSearch()
{
        if (page->kCBimportks->currentText().isEmpty())
                return;

        if (page->kLEimportid->text().isEmpty()) {
                KMessageBox::sorry(this,i18n("You must enter a search string."));
                return;
        }

        //listpop = new KeyServer( this,"result",WType_Dialog | WShowModal);

	dialogServer=new KDialogBase(KDialogBase::Swallow, i18n("Import Key From Keyserver"),  KDialogBase::Ok | KDialogBase::Close,KDialogBase::Ok,this,0,true);

	dialogServer->setButtonText(KDialogBase::Ok,i18n("&Import"));
	dialogServer->enableButtonOK(false);
	listpop=new searchRes();
	listpop->kLVsearch->setColumnWidthMode(0,QListView::Manual);
	listpop->kLVsearch->setColumnWidthMode(1,QListView::Manual);
	listpop->kLVsearch->setColumnWidth(0,150);
	listpop->kLVsearch->setColumnWidth(1,130);
        listpop->statusText->setText(i18n("Connecting to the server..."));
        connect(listpop->kLVsearch,SIGNAL(selectionChanged()),this,SLOT(transferKeyID()));
        connect(dialogServer,SIGNAL(okClicked()),this,SLOT(preimport()));
        connect(listpop->kLVsearch,SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),dialogServer,SIGNAL(okClicked()));

        connect(dialogServer,SIGNAL(closeClicked()),this,SLOT(handleQuit()));
        connect( listpop , SIGNAL( destroyed() ) , this, SLOT( abortSearch()));
        count=0;
        cycle=false;
        readmessage=QString::null;
        searchproc=new KProcIO(QTextCodec::codecForLocale());
        QString keyserv=page->kCBimportks->currentText();
        *searchproc<<"gpg"<<"--utf8-strings";
        if (page->cBproxyI->isChecked()) {
                searchproc->setEnvironment("http_proxy",page->kLEproxyI->text());
                *searchproc<<	"--keyserver-options"<<"honor-http-proxy";
        } else
                *searchproc<<	"--keyserver-options"<<"no-honor-http-proxy";
        *searchproc<<"--keyserver"<<keyserv<<"--command-fd=0"<<"--status-fd=2"<<"--search-keys"<<page->kLEimportid->text().stripWhiteSpace();

        keyNumbers=0;
        QObject::connect(searchproc, SIGNAL(processExited(KProcess *)),this, SLOT(slotsearchresult(KProcess *)));
        QObject::connect(searchproc, SIGNAL(readReady(KProcIO *)),this, SLOT(slotsearchread(KProcIO *)));
        searchproc->start(KProcess::NotifyOnExit,true);
	QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
	dialogServer->setMainWidget(listpop);
	listpop->setMinimumSize(listpop->sizeHint());
	listpop->setMinimumWidth(550);
        dialogServer->exec();
}
Example #23
0
void MainWindow::mkconnections()
{
    connect(bar,SIGNAL(closeClicked()),SLOT(close()));
    connect(bar,SIGNAL(maximizeClicked(bool)),SLOT(showWind(bool)));
    connect(bar,SIGNAL(hideClicked()),SLOT(showMinimized()));
    connect(playlists,SIGNAL(songAdded(QString,QString)),&library,SLOT(addSongInPlaylist(QString,QString)));
    connect(bar,SIGNAL(addFilePressed()),SLOT(addFiles()));
    connect(bar,SIGNAL(addFolderPressed()),SLOT(addFolder()));
    connect(&player,SIGNAL(inPlaylist(bool)),SLOT(changePlayerConnections(bool)));
    connect(&library,SIGNAL(newSong(Song)),table,SLOT(addSongInList(Song)));
    connect(&player,SIGNAL(positionChanged(qint64)),bar,SIGNAL(seekChanged(qint64)));
    connect(&player,SIGNAL(currentSongChanged(Song)),bar,SIGNAL(songChanged(Song)));
    connect(bar,SIGNAL(playClicked()),&player,SLOT(playpause()));
    connect(addFile,SIGNAL(triggered()),SLOT(addFiles()));
    connect(actionAddFolder,SIGNAL(triggered()),SLOT(addFolder()));
    connect(actionOuvrir,SIGNAL(triggered()),SLOT(openFile()));
    connect(bar,SIGNAL(volumeChanged(int)),&player,SLOT(setVolume(int)));
    connect(bar,SIGNAL(positionChanged(int)),&player,SLOT(setPosition(int)));
    connect(bar,SIGNAL(seekBarPressed()),&player,SLOT(pause()));
    connect(bar,SIGNAL(seekBarReleased()),&player,SLOT(play()));
    connect(&player,SIGNAL(playbackStateChanged(bool)),bar,SLOT(changeButton(bool)));
    connect(tree,SIGNAL(albumChosen(QString,QString)),table,SLOT(showSongsFrom(QString,QString)));
    connect(tree,SIGNAL(artistChosen(QString)),table,SLOT(showSongsBy(QString)));
    connect(&library,SIGNAL(libraryChanged(Library*)),tree,SLOT(updateTree(Library*)));
    connect(table,SIGNAL(newPlaylist(Song)),this,SLOT(mkPlaylist(Song)));
    connect(playlists,SIGNAL(playlistChosen(QString)),table,SLOT(showSongsIn(QString)));
    connect(table,SIGNAL(deleteSong(Song,bool)),&library,SLOT(deleteSong(Song,bool)));
    connect(bar,SIGNAL(newQuery(QString,int)),table,SLOT(setQuery(QString,int)));
    connect(bar,SIGNAL(newPlaybackMode(QMediaPlaylist::PlaybackMode)),&player,SLOT(setPlayBackMode(QMediaPlaylist::PlaybackMode)));
    connect(table,SIGNAL(songChosen(int)),&player,SLOT(play(int)));
    connect(table,SIGNAL(newSongList(SongList)),&player,SLOT(update(SongList)));
    connect(&player,SIGNAL(inPlaylist(bool)),bar,SLOT(enableNavigation(bool)));
    connect(bar,SIGNAL(miniLecteur()),&mLecteur,SLOT(show()));
    connect(bar,SIGNAL(miniLecteur()),SLOT(hide()));
    connect(&mLecteur,SIGNAL(windowedMode()),SLOT(show()));
    connect(&mLecteur,SIGNAL(positionChanged(int)),bar,SIGNAL(positionChanged(int)));
    connect(&mLecteur,SIGNAL(seekBarPressed()),bar,SIGNAL(seekBarPressed()));
    connect(&mLecteur,SIGNAL(seekBarReleased()),bar,SIGNAL(seekBarReleased()));
    connect(&mLecteur,SIGNAL(positionChanged(int)),bar,SIGNAL(positionChanged(int)));
    connect(&mLecteur,SIGNAL(playClicked()),bar,SIGNAL(playClicked()));
    connect(&mLecteur,SIGNAL(nextClicked()),bar,SIGNAL(nextClicked()));
    connect(&mLecteur,SIGNAL(previousClicked()),bar,SIGNAL(previousClicked()));
    connect(&mLecteur,SIGNAL(volumeChanged(int)),bar,SIGNAL(volumeChanged(int)));
    connect(&player,SIGNAL(currentSongChanged(Song)),&mLecteur,SLOT(setNewSong(Song)));
    connect(&player,SIGNAL(positionChanged(qint64)),&mLecteur,SLOT(setPosition(qint64)));
    connect(&player,SIGNAL(playbackStateChanged(bool)),&mLecteur,SLOT(changeButton(bool)));
    connect(&player,SIGNAL(indexChanged(int,int)),table,SLOT(setIconTo(int,int)));
    connect(table,SIGNAL(addFileTriggered()),SLOT(addFiles()));
    connect(table,SIGNAL(addFolderTriggered()),SLOT(addFolder()));

}
Example #24
0
void
TabView::setBlank(BlankStatePage *blank)
{
    blank_ = blank;
    blank->hide();
    stack->insertWidget(1, blank); // blank state always at index 1

    // and when stuff happens lets check
    connect(blank, SIGNAL(closeClicked()), this, SLOT(checkBlank()));
    connect(context->athlete->metricDB, SIGNAL(dataChanged()), this, SLOT(checkBlank()));
    connect(context, SIGNAL(configChanged()), this, SLOT(checkBlank()));
    connect(trainDB, SIGNAL(dataChanged()), this, SLOT(checkBlank()));

}
Example #25
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 );
}
Example #26
0
void OSPlugin::connectDocumentSignals(OSDocument* osDocument)
{
  bool test;
  test = connect( osDocument, SIGNAL(closeClicked()), this, SLOT(hideSender()) );
  OS_ASSERT(test);
  //test = connect( osDocument, SIGNAL(exitClicked()), this, SLOT(quit()) );
  //OS_ASSERT(test);
  test = connect( osDocument, SIGNAL(importClicked()), this, SLOT(importIdfForSender()) );
  OS_ASSERT(test);
  test = connect( osDocument, SIGNAL(loadFileClicked()), this, SLOT(openForSender()) );
  OS_ASSERT(test);
  test = connect( osDocument, SIGNAL(newClicked()), this, SLOT(newForSender()) );
  OS_ASSERT(test);
  test = connect( osDocument, SIGNAL(helpClicked()), this, SLOT(showHelp()) );
  OS_ASSERT(test);
}
Example #27
0
void Mpdf::initTop1()
{
    closeButton = new QPushButton;
    closeButton->setText("X");
    closeButton->setMaximumWidth(30);

    spacerItem1 = new QSpacerItem(30, 30, 
            QSizePolicy::Expanding, QSizePolicy::Minimum);

    top1Layout = new QHBoxLayout;
    top1Layout->addWidget(closeButton);
    top1Layout->addItem(spacerItem1);

    connect(closeButton, SIGNAL(clicked()),
            this, SLOT(closeClicked()));
}
Example #28
0
YaEventNotifier::YaEventNotifier(QWidget* parent)
	: QWidget(parent)
	, psi_(0)
{
	QVBoxLayout* vbox = new QVBoxLayout(this);
	vbox->setMargin(0);
	eventNotifierFrame_ = new YaEventNotifierFrame(this);
	vbox->addWidget(eventNotifierFrame_);

	connect(eventNotifierFrame_, SIGNAL(skip()), SLOT(skip()));
	connect(eventNotifierFrame_, SIGNAL(read()), SLOT(read()));
	connect(eventNotifierFrame_, SIGNAL(closeClicked()), SLOT(skipAll()));

	connect(GlobalEventQueue::instance(), SIGNAL(queueChanged()), SLOT(update()), Qt::QueuedConnection);
	update();
}
EquipmentWriter::EquipmentWriter() {
    QWidget *widget = new QWidget;
    ui.setupUi( widget );
    ui.tabWidget->setCurrentIndex(0);
    setMainWidget( widget );
    setCaption( i18n( "Define Equipment" ) );
    setButtons( KDialog::Close );
    ks = KStars::Instance();
    nextScope = 0;
    nextEyepiece = 0;
    nextFilter = 0;
    nextLens = 0;
    loadEquipment();
    newScope = true;
    newEyepiece = true;
    newLens = true;
    newFilter = true;


    #ifdef HAVE_INDI_H
    ui.driverComboBox->insertItems(1, DriverManager::Instance()->getDriversStringList());
    #endif

    //make connections
    connect( this, SIGNAL( closeClicked() ), this, SLOT( slotClose() ) );
    connect( ui.NewScope, SIGNAL( clicked() ), this, SLOT( slotNewScope() ) );
    connect( ui.NewEyepiece, SIGNAL( clicked() ), this, SLOT( slotNewEyepiece() ) );
    connect( ui.NewLens, SIGNAL( clicked() ), this, SLOT( slotNewLens() ) );
    connect( ui.NewFilter, SIGNAL( clicked() ), this, SLOT( slotNewFilter() ) );
    connect( ui.AddScope, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.AddEyepiece, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.AddLens, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.AddFilter, SIGNAL( clicked() ), this, SLOT( slotSave() ) );
    connect( ui.ScopeList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetScope(QString) ) );
    connect( ui.EyepieceList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetEyepiece(QString) ) );
    connect( ui.LensList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetLens(QString) ) );
    connect( ui.FilterList, SIGNAL( currentTextChanged(const QString) ),
             this, SLOT( slotSetFilter(QString) ) );
    connect( ui.RemoveScope, SIGNAL( clicked() ), this, SLOT( slotRemoveScope() ) );
    connect( ui.RemoveEyepiece, SIGNAL( clicked() ), this, SLOT( slotRemoveEyepiece() ) );
    connect( ui.RemoveLens, SIGNAL( clicked() ), this, SLOT( slotRemoveLens() ) );
    connect( ui.RemoveFilter, SIGNAL( clicked() ), this, SLOT( slotRemoveFilter() ) );
}
int MainWindowImpl::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: openClicked(); break;
        case 1: saveAsClicked(); break;
        case 2: closeClicked(); break;
        case 3: aboutClicked(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}