コード例 #1
0
ファイル: log_wnd.cpp プロジェクト: glockwork/dfu
LogWnd::LogWnd( QWidget * parent, QtLua::State * st )
: QWidget( parent ), 
  Binder( st )
{
    pd = new PD();
    pd->linesCnt = 128;
    pd->ui.setupUi( this );

    connect( st,   SIGNAL(output(const QString &)), this, SLOT(log(const QString &)) );

    connect( this, SIGNAL(sigLog(const QString &)), this, SLOT(slotLog(const QString &)), Qt::QueuedConnection );
    connect( this, SIGNAL(sigLinesCnt(int)),        this, SLOT(slotLinesCnt(int)),        Qt::QueuedConnection );
    connect( this, SIGNAL(sigClear()),              this, SLOT(slotClear()),              Qt::QueuedConnection );

    connect( pd->ui.clear, SIGNAL(clicked()), this, SLOT(slotClear()), Qt::QueuedConnection );
}
コード例 #2
0
ファイル: lineedit.cpp プロジェクト: DanMan/quiterss
LineEdit::LineEdit(QWidget *parent, const QString &text)
  : QLineEdit(parent)
  , textLabel_(0)
{
  clearButton = new QToolButton(this);
  clearButton->setFocusPolicy(Qt::NoFocus);
  QPixmap pixmap(":/images/editClear");
  clearButton->setIcon(QIcon(pixmap));
  clearButton->setIconSize(pixmap.size());
  clearButton->setCursor(Qt::ArrowCursor);
  clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
  clearButton->hide();

  if (!text.isEmpty()) {
    textLabel_ = new QLabel(this);
    textLabel_->setStyleSheet("QLabel { color: gray; }");
    textLabel_->setText(text);
  }

  connect(clearButton, SIGNAL(clicked()), this, SLOT(slotClear()));
  connect(this, SIGNAL(textChanged(const QString&)),
          SLOT(updateClearButton(const QString&)));
  int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
  setStyleSheet(QString("QLineEdit { padding-right: %1px; }").
                arg(clearButton->sizeHint().width() + frameWidth + 1));
  QSize msz = minimumSizeHint();
  setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
                 qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
}
コード例 #3
0
KLineEditDlg::KLineEditDlg( const QString&_text, const QString& _value,
                            QWidget *parent )
    : KDialogBase( Plain, QString::null, Ok|Cancel|User1, Ok, parent, 0L, true,
                   true, KStdGuiItem::clear() )
{
    QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), 0, spacingHint() );
    QLabel *label = new QLabel(_text, plainPage() );
    topLayout->addWidget( label, 1 );

    edit = new KLineEdit( plainPage(), 0L );
    edit->setMinimumWidth(edit->sizeHint().width() * 3);
    label->setBuddy(edit);  // please "scheck" style
    //  connect( edit, SIGNAL(returnPressed()), SLOT(accept()) );
    connect( edit, SIGNAL(textChanged(const QString&)),
             SLOT(slotTextChanged(const QString&)) );
    topLayout->addWidget( edit, 1 );

    connect( this, SIGNAL(user1Clicked()), this, SLOT(slotClear()) );
    edit->setText( _value );
    if ( _value.isEmpty() )
    {
        enableButtonOK( false );
        enableButton(KDialogBase::User1, false);
    }
    edit->setSelection(0, edit->text().length());
    edit->setFocus();
}
コード例 #4
0
int PanelKMenu::insertClientMenu(KickerClientMenu *p)
{
    int id = client_id;
    clients.insert(id, p);
    slotClear();
    return id;
}
コード例 #5
0
ファイル: menu_media.cpp プロジェクト: fuji7l/KDesktop-Menu
MenuMedia::MenuMedia()
    : KPanelMenu( QString::null, 0, "Media" ),
    mMenuId(0)
{
	disableAutoClear();
	setCaption(i18n("Media Menu"));

	m_DirLister = new KDirLister();
	connect( m_DirLister, SIGNAL( clear() ), this, SLOT( slotClear() ) );
	connect( m_DirLister, SIGNAL( started(const KURL&) ),
	         this, SLOT( slotStarted(const KURL&) ) );
	connect( m_DirLister, SIGNAL( completed() ),
	         this, SLOT( slotCompleted() ) );
	connect( m_DirLister, SIGNAL( newItems( const KFileItemList & ) ),
	         this, SLOT( slotNewItems( const KFileItemList & ) ) );
	connect( m_DirLister, SIGNAL( deleteItem( KFileItem * ) ),
	         this, SLOT( slotDeleteItem( KFileItem * ) ) );
	connect( m_DirLister, SIGNAL( refreshItems( const KFileItemList & ) ),
	         this, SLOT( slotRefreshItems( const KFileItemList & ) ) );

	m_ExcludedTypesList.clear();
	m_ExcludedTypesList << "media/hdd_mounted";
	m_ExcludedTypesList << "media/hdd_unmounted";
	m_ExcludedTypesList << "media/nfs_mounted";
	m_ExcludedTypesList << "media/nfs_unmounted";
	m_ExcludedTypesList << "media/smb_mounted";
	m_ExcludedTypesList << "media/smb_unmounted";
}
コード例 #6
0
ファイル: stationinfo.cpp プロジェクト: etengabeko/metromap
StationInfoWidget::~StationInfoWidget()
{
  slotClear();

  delete m_ui;
  m_ui = 0;
}
コード例 #7
0
ファイル: PlayList.cpp プロジェクト: tedfelix/rosegarden
PlayList::PlayList(QWidget *parent) : QWidget(parent),
        m_listView(new PlayListView(this)),
        m_buttonBar(new QFrame(this)),
        m_barLayout(new QHBoxLayout(m_buttonBar)),
        m_playButton(0),
        m_moveUpButton(0),
        m_moveDownButton(0),
        m_deleteButton(0),
        m_clearButton(0)
{
    QVBoxLayout *vLayout = new QVBoxLayout;
    vLayout->addWidget(m_listView);
    vLayout->addWidget(m_buttonBar);
    setLayout(vLayout);

    m_openButton = new QPushButton(m_buttonBar);
    m_playButton = new QPushButton(m_buttonBar);
    m_moveUpButton = new QPushButton(m_buttonBar);
    m_moveDownButton = new QPushButton(m_buttonBar);
    m_deleteButton = new QPushButton(m_buttonBar);
    m_clearButton = new QPushButton(m_buttonBar);
    m_barLayout->addWidget(m_openButton);
    m_barLayout->addWidget(m_playButton);
    m_barLayout->addWidget(m_moveUpButton);
    m_barLayout->addWidget(m_moveDownButton);
    m_barLayout->addWidget(m_deleteButton);
    m_barLayout->addWidget(m_clearButton);
    m_barLayout->addStretch();


    m_openButton ->setText(tr("Add..."));
    m_playButton ->setText(tr("Play"));
    m_moveUpButton ->setText(tr("Move Up"));
    m_moveDownButton->setText(tr("Move Down"));
    m_deleteButton ->setText(tr("Remove"));
    m_clearButton ->setText(tr("Clear whole List"));

    connect(m_openButton, SIGNAL(clicked()), SLOT(slotOpenFiles()));
    connect(m_playButton, SIGNAL(clicked()),SLOT(slotPlay()));
    connect(m_deleteButton, SIGNAL(clicked()), SLOT(slotDeleteCurrent()));
    connect(m_clearButton, SIGNAL(clicked()), SLOT(slotClear()));
    connect(m_moveUpButton, SIGNAL(clicked()), SLOT(slotMoveUp()));
    connect(m_moveDownButton, SIGNAL(clicked()), SLOT(slotMoveDown()));
    
    connect(m_listView, SIGNAL(droppedURIs(QDropEvent*, QTreeWidget*, QStringList)),
            SLOT(slotDroppedURIs(QDropEvent*, QTreeWidget*, QStringList)));
    
    connect(m_listView, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
                this, SLOT(slotCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)));
    
//     connect(m_listView, SIGNAL(currentChanged(QTreeWidgetItem*)),
//             SLOT(slotCurrentItemChanged(QTreeWidgetItem*)));
//     connect(m_listView, SIGNAL(dropped(QDropEvent*, QTreeWidgetItem*)),
//             SLOT(slotDropped(QDropEvent*, QTreeWidgetItem*)));

    restore();

    enableButtons(0);

}
コード例 #8
0
ファイル: diffwidget.cpp プロジェクト: serghei/kde3-kdevelop
void DiffWidget::setDiff( const QString& diff )
{
  slotClear();
  rawDiff = diff;
  slotAppend( diff );
  slotFinished();
}
コード例 #9
0
ファイル: scribble.cpp プロジェクト: AliYousuf/univ-aca-mips
Scribble::Scribble( QWidget *parent, const char *name )
    : QMainWindow( parent, name )
{
    canvas = new Canvas( this );
    setCentralWidget( canvas );

    QToolBar *tools = new QToolBar( this );

    bSave = new QToolButton( QPixmap(), "Save", "Save as PNG image", this, SLOT( slotSave() ), tools );
    bSave->setText( "Save as..." );

    tools->addSeparator();

    bPColor = new QToolButton( QPixmap(), "Choose Pen Color", "Choose Pen Color", this, SLOT( slotColor() ), tools );
    bPColor->setText( "Choose Pen Color..." );

    tools->addSeparator();

    bPWidth = new QSpinBox( 1, 20, 1, tools );
    QToolTip::add( bPWidth, "Choose Pen Width" );
    connect( bPWidth, SIGNAL( valueChanged( int ) ), this, SLOT( slotWidth( int ) ) );
    bPWidth->setValue( 3 );

    tools->addSeparator();

    bClear = new QToolButton( QPixmap(), "Clear Screen", "Clear Screen", this, SLOT( slotClear() ), tools );
    bClear->setText( "Clear Screen" );
}
コード例 #10
0
KLineEditDlg::KLineEditDlg( const QString&_text, const QString& _value,
                            QWidget *parent, bool _file_mode )
    : QDialog( parent, 0L, true )
{
    QGridLayout *layout = new QGridLayout(this, 4, 3, 10);

    QLabel *label = new QLabel(_text, this);
    layout->addWidget(label, 0, 0, AlignLeft);

    edit = new KLineEdit( this, 0L );
    edit->setMinimumWidth(edit->sizeHint().width() * 3);
    connect( edit, SIGNAL(returnPressed()), SLOT(accept()) );

    if ( _file_mode ) {
        completion = new KURLCompletion();
        edit->setCompletionObject( completion );
        edit->setAutoDeleteCompletionObject( true );
    } else
        completion = 0L;

    layout->addMultiCellWidget(edit, 1, 1, 0, _file_mode ? 1 : 2);
    layout->setColStretch(1, 1);

    if (_file_mode) {
        QPushButton *browse = new QPushButton(i18n("&Browse..."), this);
        layout->addWidget(browse, 1, 2, AlignCenter);
        connect(browse, SIGNAL(clicked()),
                SLOT(slotBrowse()));
    }

    QFrame *hLine = new QFrame(this);
    hLine->setFrameStyle(QFrame::Sunken|QFrame::HLine);
    layout->addMultiCellWidget(hLine, 2, 2, 0, 2);

    KButtonBox *bBox = new KButtonBox(this);
    layout->addMultiCellWidget(bBox, 3, 3, 0, 2);

    QPushButton *ok = bBox->addButton(KStdGuiItem::ok());
    ok->setDefault(true);
    connect( ok, SIGNAL(clicked()), SLOT(accept()));

    bBox->addStretch(1);

    QPushButton *clear = bBox->addButton(KStdGuiItem::clear());
    connect( clear, SIGNAL(clicked()), SLOT(slotClear()));

    bBox->addStretch(1);

    QPushButton *cancel = bBox->addButton(KStdGuiItem::cancel());
    connect( cancel, SIGNAL(clicked()), SLOT(reject()));

    bBox->layout();

    layout->activate();

    edit->setText( _value );
    edit->setSelection(0, edit->text().length());
    edit->setFocus();
}
コード例 #11
0
void MainWindow::slotNew()        		//新建一个显示窗体
{
    slotClear();
    initScene();

    MainWindow *newWin = new MainWindow;
    newWin->show();
}
コード例 #12
0
ファイル: trashapplet.cpp プロジェクト: serghei/kde3-kdebase
TrashApplet::~TrashApplet()
{
    // disconnect the dir lister before quitting so as not to crash
    // on kicker exit
    disconnect(mpDirLister, SIGNAL(clear()), this, SLOT(slotClear()));
    delete mpDirLister;
    KGlobal::locale()->removeCatalogue("trashapplet");
}
コード例 #13
0
void PropertiesAndStyleWidget::createConnect()
{
    connect(mToolBar,SIGNAL(sigAddParamter()),mPropTableWidget,SLOT(slotAdd()));
    connect(mToolBar,SIGNAL(sigRemoveParamter()),mPropTableWidget,SLOT(slotRemove()));
    connect(mToolBar,SIGNAL(sigClearParameter()),mPropTableWidget,SLOT(slotClear()));
    connect(mToolBar,SIGNAL(sigSubumit()),mPropTableWidget,SLOT(slotSubmit()));

    connect(mPropTableWidget,SIGNAL(sigAddDeleteEnable(bool,bool)),mToolBar,SLOT(slotSetBtnsEnable(bool,bool)));
}
コード例 #14
0
ファイル: dirmodel.cpp プロジェクト: markg85/Porpoise
DirModelPrivate::DirModelPrivate(DirModel *model)
    : q(model)
    , m_lister(new KDirListerV2())
    , m_url()
{
    connect(m_lister, SIGNAL(directoryContentChanged(KDirectory*)), this, SLOT(itemsAdded(KDirectory*)));
    connect(m_lister, SIGNAL(completed(KDirectory*)), this, SLOT(folderCompleted(KDirectory*)));
    connect(m_lister, SIGNAL(clear()), this, SLOT(slotClear()));
}
コード例 #15
0
ファイル: contexthelp.cpp プロジェクト: ktechlab/ktechlab-0.3
ContextHelp::ContextHelp( KateMDI::ToolView * parent )
	: QWidget(parent), Ui::ContextHelpWidget( /* parent */ )
{
    setupUi(this);

	QWhatsThis::add( this, i18n("Provides context-sensitive help relevant to the current editing being performed.") );
	setAcceptDrops( true );
	
    if (parent->layout()) {
        parent->layout()->addWidget(this);
        qDebug() << Q_FUNC_INFO << " added item selector to parent's layout " << parent;
    } else {
        qWarning() << Q_FUNC_INFO << " unexpected null layout on parent " << parent ;
    }

	QFont font;
	font.setBold( true );
	if ( font.pointSize() != 0 )
		font.setPointSize( int(font.pointSize() * 1.4) );
	m_pNameLabel->setFont( font );
	m_pNameLabel->setTextFormat( Qt::RichText );
	
	m_pBrowser = new KHTMLPart( m_pWidgetStack->widget( 0 ) );
	m_pBrowserView = m_pBrowser->view();
	m_pBrowserView->setFocusPolicy( Qt::NoFocus );
	m_pBrowserLayout->addWidget( m_pBrowserView );
	connect( m_pBrowser->browserExtension(), SIGNAL(openUrlRequest( const KUrl &, const KParts::OpenUrlArguments & ) ),
			 this, SLOT( openURL(const KUrl & /*, const KParts::OpenUrlArguments & */ ) ) );
	
	// Adjust appearance of browser
	m_pBrowserView->setMarginWidth( 4 );
	
	m_pEditor = new RichTextEditor( m_pWidgetStack->widget( 1 ), "ContextHelpEditor" );
	m_pTopLayout->addWidget( m_pEditor );
	
	m_pEditor->installEventFilter( this );
	m_pEditor->editorViewport()->installEventFilter( this );
	slotClear();
	
	connect( m_pEditButton, SIGNAL(clicked()), this, SLOT(slotEdit()) );
	connect( m_pSaveButton, SIGNAL(clicked()), this, SLOT(slotSave()) );
	connect( m_pResetButton, SIGNAL(clicked()), this, SLOT(slotEditReset()) );
	connect( m_pChangeDescriptionsDirectory, SIGNAL(clicked()), this, SLOT(requestItemDescriptionsDirectory()) );
	connect( m_pLanguageSelect, SIGNAL(activated(const QString &)), this, SLOT(setCurrentLanguage( const QString& )) );
	
	m_pResetButton->setPixmap( KIconLoader::global()->loadIcon( "button_cancel", KIconLoader::Small ) );
	m_pChangeDescriptionsDirectory->setPixmap( KIconLoader::global()->loadIcon( "folder", KIconLoader::Small ) );
	
	
	connect( ComponentSelector::self(), SIGNAL(itemSelected( const QString& )), this, SLOT(setBrowserItem( const QString& )) );
	connect( FlowPartSelector::self(), SIGNAL(itemSelected( const QString& )), this, SLOT(setBrowserItem( const QString& )) );
#ifdef MECHANICS
	connect( MechanicsSelector::self(), SIGNAL(itemSelected( const QString& )), this, SLOT(setBrowserItem( const QString& )) );
#endif
	
	QTimer::singleShot( 10, this, SLOT(slotInitializeLanguageList()) );
}
コード例 #16
0
ファイル: findfilesdialog.cpp プロジェクト: fagu/kileip
void FindFilesDialog::setDirName(const QString &dir)
{
	KComboBox *combo = dir_combo->comboBox();

	if (findListItem(combo, dir) < 0) {
		combo->addItem(dir);
	}
	if (combo->itemText(0) != dir) {
		slotClear();
	}
}
コード例 #17
0
ファイル: scribblescripter.cpp プロジェクト: aschet/qsaqt5
Scribble::Scribble( QWidget *parent, const char *name )
    : QMainWindow(parent)
{
    setObjectName(QLatin1String(name));

    canvas = new Canvas( this );
    setCentralWidget( canvas );

    tools = new QToolBar;
    addToolBar(tools);

    bSave = tools->addAction("Save As...", this, SLOT(slotSave()));
    bSave->setToolTip("Save as PNG image");
    bSave->setIconText("Save");

    tools->addSeparator();

    bPColor = tools->addAction("Choose Pen Color...", this, SLOT(slotColor()));
    bPColor->setToolTip("Choose Pen Color");
    bPColor->setIconText("Choose Pen Color");

    tools->addSeparator();

    bPWidth = new QSpinBox;
    bPWidth->setMinimum(1);
    bPWidth->setMaximum(20);
    bPWidth->setSingleStep(1);
    tools->addWidget(bPWidth);
    bPWidth->setToolTip("Choose Pen Width");
    connect( bPWidth, SIGNAL( valueChanged( int ) ), this, SLOT( slotWidth( int ) ) );
    bPWidth->setValue( 3 );

    tools->addSeparator();

    bClear = tools->addAction("Clear screen", this, SLOT(slotClear()));
    bClear->setToolTip("Clear Screen");
    bClear->setIconText("Clear Screen");

    project = new QSProject( this, "scribblescript_project" );
    interpreter = project->interpreter();
#ifndef QSA_NO_GUI
	QSInputDialogFactory *factory = new QSInputDialogFactory();
    interpreter->addObjectFactory( factory );
#endif

    project->addObject( new CanvasInterface( canvas, this, "Canvas" ) );
    project->load( "scribblescript.qsa" );
    connect( project, SIGNAL( projectEvaluated() ), project, SLOT( save() ) );

    selector = new ScriptView( interpreter, false, this );
    selector->setWindowTitle("ScribbleScripts");
    addDockWidget(Qt::LeftDockWidgetArea, selector);
    selector->show();
}
コード例 #18
0
ファイル: centralwidget.cpp プロジェクト: alesapin/LSPL-IDE
CentralWidget::CentralWidget(QWidget *parent) : QWidget(parent), timeOut(DEFAULT_TIMEOUT)
{

    watcher = new QFutureWatcher<QSharedPointer<PatternViewMap>>();
    compiler = new PatternCompiler();
    txt = new TextBasicWidget(this);
    pattern = new PatternsBasicWidget(compiler,this);
    matches = new MatchesBasicWidget(this);
    timeoutTimer = new QTimer(this);
    timeoutTimer->setSingleShot(true);
    QSplitter* vert = new QSplitter();
    QSplitter* horiz = new QSplitter();
    QWidget* containter = new QWidget();
    QHBoxLayout* containterLay = new QHBoxLayout();
    QVBoxLayout* mainLay = new QVBoxLayout();
    containterLay->setContentsMargins(0,0,0,0);
    horiz->addWidget(txt);
    horiz->addWidget(pattern);
    containterLay->addWidget(horiz);
    containter->setLayout(containterLay);
    vert->setOrientation(Qt::Vertical);
    vert->addWidget(containter);
    vert->addWidget(matches);

//    vert->addWidget(progress);
    mainLay->addWidget(vert);
    setLayout(mainLay);
    connect(pattern,SIGNAL(matchClicked()), this,SLOT(slotAnalyze()));
    connect(matches,SIGNAL(patternWasUnchecked(QString)),txt,SLOT(slotPatternUncheked(QString)));
    connect(matches,SIGNAL(patternWasChecked(QString)),txt,SLOT(slotPatternChecked(QString)));
    connect(matches,SIGNAL(showAll()),txt,SLOT(slotHighlightAll()));
    connect(matches,SIGNAL(showAll()),pattern,SLOT(slotDisableMatch()));
    connect(matches,SIGNAL(hideAll()),txt,SLOT(slotDehighlightAll()));
    connect(matches,SIGNAL(rowClicked(int,int)),txt,SLOT(slotSelectFragment(int,int)));
    connect(matches,SIGNAL(patternWasUnchecked(QString)),this,SIGNAL(statusHighlighting()));
    connect(matches,SIGNAL(patternWasChecked(QString)),this,SIGNAL(statusHighlighting()));

    connect(txt,SIGNAL(tabChanged(int)),matches,SLOT(slotChangeTab(int)));
    connect(txt,SIGNAL(tabClosed(int)),matches,SLOT(slotCloseTab(int)));
    connect(txt,SIGNAL(editEnabled()),matches,SLOT(slotClear()));
    connect(txt,SIGNAL(editEnabled()),this,SLOT(slotEdit()));
    connect(txt,SIGNAL(checkingEnabled()),matches,SLOT(slotEnableChecking()));
    connect(txt,SIGNAL(checkingEnabled()),this,SIGNAL(statusReady()));
    connect(txt, SIGNAL(checkingEnabled()),pattern, SLOT(slotEnableMatch()));

    connect(watcher,SIGNAL(finished()),this,SLOT(slotDisplay()));
    connect(timeoutTimer,SIGNAL(timeout()),this,SLOT(slotTimeout()));

    //connect(watcher,SIGNAL(progressValueChanged(int)),this,SLOT(slotProgress(int)));
    if (QFile::exists(CRASH_TEXT) && QFile::exists(CRASH_PATTERNS)){
        loadAfterCrash(CRASH_TEXT, CRASH_PATTERNS);
    }
}
コード例 #19
0
ファイル: itemeditor.cpp プロジェクト: zoltanp/ktechlab-0.3
void ItemEditor::slotUpdate( ItemGroup * itemGroup )
{
	if (!itemGroup)
	{
		slotClear();
		return;
	}
	
	m_pPropertyEditor->create(itemGroup);
	updateNameLabel(itemGroup->activeItem());
	
	m_pOrientationWidget->slotUpdate( dynamic_cast<CNItemGroup *>(itemGroup) );
}
コード例 #20
0
KisPainterlyMixer::KisPainterlyMixer(QWidget *parent)
        : QWidget(parent)
{
    setupUi(this);

    initSpots();

    // XXX: ask Enkithan for a palette-knife icon
    bnMix->setIcon(KIcon("krita_tool_knife"));
    bnPick->setIcon(KIcon("krita_tool_color_picker"));
    bnPan->setIcon(KIcon("krita_tool_move"));
    m_bErase->setIcon(KIcon("edit-delete"));
    connect(m_bErase, SIGNAL(clicked()), m_canvas, SLOT(slotClear()));

    //connect(sliderRadius, SIGNAL(valueChanged(int)), m_canvas->mixerTool(), SLOT(setRadius(qreal)));
}
コード例 #21
0
ファイル: contexthelp.cpp プロジェクト: ktechlab/ktechlab-0.3
void ContextHelp::slotUpdate( Item * item )
{
	if ( isEditChanged() )
		return;
	
	m_lastItemType = item ? item->type() : QString::null;
	m_pEditButton->setEnabled( item );
	
	if ( !item )
	{
		slotClear();
		return;
	}
	
	m_pWidgetStack->raiseWidget( 0 );
	setContextHelp( item->name(), itemLibrary()->description( m_lastItemType, KGlobal::locale()->language() ) );
}
コード例 #22
0
void KWatchGnuPGMainWindow::createActions()
{
  (void)new KAction( i18n("C&lear History"), "history_clear", CTRL+Key_L,
		     this, SLOT( slotClear() ),
		     actionCollection(), "clear_log" );
  (void)KStdAction::saveAs( this, SLOT(slotSaveAs()), actionCollection() );
  (void)KStdAction::close( this, SLOT(close()), actionCollection() );
  (void)KStdAction::quit( this, SLOT(slotQuit()), actionCollection() );
  (void)KStdAction::preferences( this, SLOT(slotConfigure()), actionCollection() );
  ( void )KStdAction::keyBindings(this, SLOT(configureShortcuts()), actionCollection());
  ( void )KStdAction::configureToolbars(this, SLOT(slotConfigureToolbars()), actionCollection());

#if 0
  (void)new KAction( i18n("Configure KWatchGnuPG..."), QString::fromLatin1("configure"),
					 0, this, SLOT( slotConfigure() ),
					 actionCollection(), "configure" );
#endif

}
コード例 #23
0
ファイル: trashapplet.cpp プロジェクト: serghei/kde3-kdebase
TrashApplet::TrashApplet(const QString &configFile, Type type, int actions, QWidget *parent, const char *name)
    : KPanelApplet(configFile, type, actions, parent, name), mButton(0)
{
    mButton = new TrashButton(this);

    if(!parent)
        setBackgroundMode(X11ParentRelative);

    mButton->setPanelPosition(position());

    setAcceptDrops(true);

    mpDirLister = new KDirLister();

    connect(mpDirLister, SIGNAL(clear()), this, SLOT(slotClear()));
    connect(mpDirLister, SIGNAL(completed()), this, SLOT(slotCompleted()));
    connect(mpDirLister, SIGNAL(deleteItem(KFileItem *)), this, SLOT(slotDeleteItem(KFileItem *)));

    mpDirLister->openURL("trash:/");
}
コード例 #24
0
void OrientationWidget::slotUpdate( CNItemGroup * itemGroup )
{
	if ( m_pCNItem )
		m_pCNItem->disconnect( this );
	
	m_pCNItem = dynamic_cast<CNItem*>( itemGroup->activeItem() );
	if ( m_pCNItem )
		connect( m_pCNItem, SIGNAL(orientationChanged()), this, SLOT(updateShownOrientation()) );
	
	bool haveSameOrientation = itemGroup->haveSameOrientation();
	
	if ( FlowPart * flowPart = dynamic_cast<FlowPart*>((CNItem*)m_pCNItem) )
	{
		// Do we actually need to udpate the interface?
		if ( m_pFlowPart && (m_bHaveSameOrientation == haveSameOrientation) )
			return;
		
		m_pComponent = 0l;
		m_pFlowPart = flowPart;
		m_bHaveSameOrientation = haveSameOrientation;
		
		initFromFlowPart( m_pFlowPart );
	}
	
	else if ( Component * component = dynamic_cast<Component*>((CNItem*)m_pCNItem) )
	{
		// Do we actually need to udpate the interface?
		if ( m_pComponent && (m_bHaveSameOrientation == haveSameOrientation) )
			return;
		
		m_pFlowPart = 0l;
		m_pComponent = component;
		m_bHaveSameOrientation = haveSameOrientation;
		
		initFromComponent( m_pComponent );
	}
	
	else
		slotClear();
}
コード例 #25
0
ファイル: itemeditor.cpp プロジェクト: zoltanp/ktechlab-0.3
ItemEditor::ItemEditor( KateMDI::ToolView * parent )
	: QWidget( (QWidget*)parent, "Item Editor" )
{
	QWhatsThis::add( this, i18n("This allows editing of advanced properties of the selected item(s). Right click on the picture of the item to set the orientation.") );
	
	QVBoxLayout * vlayout = new QVBoxLayout( this, 0, 6 );

	//BEGIN Create Name Label
	m_pNameLabel = new QLabel( this, "" );
	m_pNameLabel->setTextFormat( RichText );
	
	QFont font;
	font.setBold( true );
	if ( font.pointSize() != 0 )
		font.setPointSize( int(font.pointSize() * 1.4) );
	m_pNameLabel->setFont( font );
	//END Create Name Label

	m_pPropertyEditor = new PropertyEditor(this);
	QWhatsThis::add(m_pPropertyEditor,i18n("<qt>Shows properties associated with the currently selected item(s).<p>Select a property to change its value. If multiple items are selected with different values then the property will appear greyed out, use ""Merge Properties"" to make them the same.<p>Select ""Defaults to set all properties to their default values""")); 
	
	m_pComponentModelWidget = new ComponentModelWidget( this );
	
	
	vlayout->addWidget( m_pNameLabel );
	vlayout->addWidget( m_pPropertyEditor, 3 );
	vlayout->addWidget( m_pComponentModelWidget, 5 );
	
	
	// Orientation widget stuff
	QHBoxLayout *h2Layout = new QHBoxLayout( vlayout, 6 );
	h2Layout->addItem( new QSpacerItem( 1, 1 ) );
	m_pOrientationWidget = new OrientationWidget(this);
	h2Layout->addWidget(m_pOrientationWidget);
	QWhatsThis::add(m_pOrientationWidget,i18n("Change the orientation of the selected item by selecting the appropriate button"));
	h2Layout->addItem( new QSpacerItem( 1, 1 ) );
	
	slotClear();
}
コード例 #26
0
// private
void kpMainWindow::setupImageMenuActions ()
{
    KActionCollection *ac = actionCollection ();

    m_actionResizeScale = new KAction (i18n ("R&esize / Scale..."), Qt::CTRL + Qt::Key_E,
        this, SLOT (slotResizeScale ()), ac, "image_resize_scale");

    m_actionCrop = new KAction (i18n ("Se&t as Image (Crop)"), Qt::CTRL + Qt::Key_T,
        this, SLOT (slotCrop ()), ac, "image_crop");

    m_actionAutoCrop = new KAction (autoCropText (), Qt::CTRL + Qt::Key_U,
        this, SLOT (slotAutoCrop ()), ac, "image_auto_crop");

    m_actionFlip = new KAction (i18n ("&Flip..."), Qt::CTRL + Qt::Key_F,
        this, SLOT (slotFlip ()), ac, "image_flip");

    m_actionRotate = new KAction (i18n ("&Rotate..."), Qt::CTRL + Qt::Key_R,
        this, SLOT (slotRotate ()), ac, "image_rotate");

    m_actionSkew = new KAction (i18n ("S&kew..."), Qt::CTRL + Qt::Key_K,
        this, SLOT (slotSkew ()), ac, "image_skew");

    m_actionConvertToBlackAndWhite = new KAction (i18n ("Reduce to Mo&nochrome (Dithered)"), 0,
        this, SLOT (slotConvertToBlackAndWhite ()), ac, "image_convert_to_black_and_white");

    m_actionConvertToGrayscale = new KAction (i18n ("Reduce to &Grayscale"), 0,
        this, SLOT (slotConvertToGrayscale ()), ac, "image_convert_to_grayscale");

    m_actionInvertColors = new KAction (i18n ("&Invert Colors"), Qt::CTRL + Qt::Key_I,
        this, SLOT (slotInvertColors ()), ac, "image_invert_colors");

    m_actionClear = new KAction (i18n ("C&lear"), Qt::CTRL + Qt::SHIFT + Qt::Key_N,
        this, SLOT (slotClear ()), ac, "image_clear");

    m_actionMoreEffects = new KAction (i18n ("&More Effects..."), Qt::CTRL + Qt::Key_M,
        this, SLOT (slotMoreEffects ()), ac, "image_more_effects");

    enableImageMenuDocumentActions (false);
}
コード例 #27
0
CBuildToolbarsetDlg::CBuildToolbarsetDlg()
{
    m_ui.setupUi(this);
    setWindowIcon(QIcon(":/images/fmlideico.ico"));

    QDir destDir( FmlCoreSettings::getDataDir() );
    QString destDirPath = destDir.absolutePath();
    if( !destDir.exists( destDirPath ) )
        destDir.mkpath( destDirPath );
    m_ui.m_path->insert( destDirPath );

    destDir.setPath(FmlCoreSettings::getXmlBtnDir());
    destDirPath = destDir.absolutePath();
    if( !destDir.exists( destDirPath ) )
        destDir.mkpath( destDirPath );
#ifdef Q_WS_MAC
    QSettings settings(QSettings::IniFormat, QSettings::UserScope, __COMPANY_DOMAIN_, QCoreApplication::applicationName() );
#else
    QSettings settings(QSettings::IniFormat, QSettings::UserScope, __COMPANY_NAME__, QCoreApplication::applicationName() );
#endif
    QStringList files = settings.value("XmlBtn/recentFileList").toStringList();
    m_ui.m_src->addItems( files );

    if( m_ui.m_src->count() == 0 )
    {
        m_ui.btnDelete->setEnabled(false);
        m_ui.btnClear->setEnabled(false);
        m_ui.btnBuild->setEnabled(false);
    }
    m_ui.m_msg->setReadOnly(true);

    connect(m_ui.btnBrowse, SIGNAL(clicked()), this, SLOT(slotBrowse()));
    connect(m_ui.btnAdd, SIGNAL(clicked()), this, SLOT(slotAdd()));
    connect(m_ui.btnDelete, SIGNAL(clicked()), this, SLOT(slotDelete()));
    connect(m_ui.btnClear, SIGNAL(clicked()), this, SLOT(slotClear()));
    connect(m_ui.btnBuild, SIGNAL(clicked()), this, SLOT(slotBuild()));
}
コード例 #28
0
void MainWindow::createActions()       	//创建主窗体的所有动作
{
    newAct = new QAction(tr("新建"),this);
    clearAct = new QAction(tr("清除"),this);
    exitAct = new QAction(tr("退出"),this);
    addEllipseItemAct = new QAction(tr("加入 椭圆"),this);
    addPolygonItemAct = new QAction(tr("加入 多边形"),this);
    addTextItemAct = new QAction(tr("加入 文字"),this);
    addRectItemAct = new QAction(tr("加入 长方形"),this);
    addAlphaItemAct = new QAction(tr("加入 透明图片"),this);
    addFlashItemAct = new QAction(tr("加入 闪烁圆"),this);
    addAnimItemAct = new QAction(tr("加入 星星"),this);

    connect(newAct,SIGNAL(triggered()),this,SLOT(slotNew()));
    connect(clearAct,SIGNAL(triggered()),this,SLOT(slotClear()));
    connect(exitAct,SIGNAL(triggered()),this,SLOT(close()));
    connect(addEllipseItemAct,SIGNAL(triggered()),this,SLOT (slotAddEllipseItem()));
    connect(addPolygonItemAct,SIGNAL(triggered()),this,SLOT (slotAddPolygonItem()));
    connect(addTextItemAct,SIGNAL(triggered()),this,SLOT (slotAddTextItem()));
    connect(addRectItemAct,SIGNAL(triggered()),this,SLOT (slotAddRectItem()));
    connect(addAlphaItemAct,SIGNAL(triggered()),this,SLOT (slotAddAlphaItem()));
    connect(addFlashItemAct,SIGNAL(triggered()),this,SLOT(slotAddFlashItem()));
    connect(addAnimItemAct,SIGNAL(triggered()),this,SLOT(slotAddAnimationItem()));
}
コード例 #29
0
ファイル: kurlrequesterdlg.cpp プロジェクト: Fat-Zer/tdelibs
void KURLRequesterDlg::initDialog(const TQString &text,const TQString &urlName)
{
   TQVBoxLayout * topLayout = new TQVBoxLayout( plainPage(), 0,
            spacingHint() );

    TQLabel * label = new TQLabel( text , plainPage() );
    topLayout->addWidget( label );

    urlRequester_ = new KURLRequester( urlName, plainPage(), "urlRequester" );
    urlRequester_->setMinimumWidth( urlRequester_->sizeHint().width() * 3 );
    topLayout->addWidget( urlRequester_ );
    urlRequester_->setFocus();
    connect( urlRequester_->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)),
             TQT_SLOT(slotTextChanged(const TQString&)) );
    bool state = !urlName.isEmpty();
    enableButtonOK( state );
    enableButton( KDialogBase::User1, state );
    /*
    KFile::Mode mode = static_cast<KFile::Mode>( KFile::File |
            KFile::ExistingOnly );
	urlRequester_->setMode( mode );
    */
    connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( slotClear() ) );
}
コード例 #30
0
WaypointImpFilterDialog::WaypointImpFilterDialog( QWidget *parent ) :
    QDialog(parent),
    centerRef(CENTER_HOMESITE)
{
    setObjectName( "WaypointImpFilterDialog" );
    setWindowTitle(tr("Waypoint Filter"));
    setModal( true );

    save.usedFilter = WaypointCatalog::Radius;
    save.radiusIdxPosition = 6;
    save.radiusIdxHome = 6;
    save.radiusIdxMap = 6;
    save.radiusIdxAirfield = 6;
    save.airfieldRefIdx = 0;

    // create checkboxes
    useAll       = new QCheckBox(tr("Check/Uncheck all"));
    airfields    = new QCheckBox(tr("&Airfields"));
    gliderfields = new QCheckBox(tr("&Gliderfields"));
    outlandings  = new QCheckBox(tr("Ou&tlandings"));
    navaids      = new QCheckBox(tr("&Navaids"));
    obstacles    = new QCheckBox(tr("O&bstacles"));
    landmarks    = new QCheckBox(tr("&Landmarks"));
    hotspots     = new QCheckBox(tr("&Hotspots"));

    connect(useAll, SIGNAL(clicked()), this, SLOT(slotChangeUseAll()));

    QVBoxLayout *typeLayout = new QVBoxLayout;
    typeLayout->setSpacing( 10 );
    typeLayout->addWidget( useAll );
    typeLayout->addSpacing( 10 );
    typeLayout->addWidget( airfields );
    typeLayout->addWidget( gliderfields );
    typeLayout->addWidget( outlandings );
    typeLayout->addWidget( navaids );
    typeLayout->addWidget( obstacles );
    typeLayout->addWidget( landmarks );
    typeLayout->addWidget( hotspots );

    QGroupBox* typeGroup = new QGroupBox( tr("Type") );
    typeGroup->setLayout( typeLayout );

    //---------------------------------------------------------------------------
    rbf0 = new QRadioButton(tr("Radius"));
    rbf1 = new QRadioButton(tr("Area"));

    QButtonGroup* filterButtonGroup = new QButtonGroup(this);
    filterButtonGroup->setExclusive(true);
    filterButtonGroup->addButton( rbf0, WaypointCatalog::Radius );
    filterButtonGroup->addButton( rbf1, WaypointCatalog::Area );

    connect( filterButtonGroup, SIGNAL( buttonClicked(int)),
             this, SLOT(slotFilterChanged(int)) );

    QHBoxLayout* filterBox = new QHBoxLayout;
    filterBox->addWidget( rbf0 );
    filterBox->addSpacing( 10 );
    filterBox->addWidget( rbf1 );
    filterBox->addStretch( 10 );

    filterGroup = new QGroupBox( tr("Filter") );
    filterGroup->setLayout( filterBox );

    //---------------------------------------------------------------------------
    fromLat  = new LatEdit;
    fromLong = new LongEdit;

    QGridLayout* fromGrid = new QGridLayout;
    fromGrid->setSpacing( 10 );
    fromGrid->addWidget( new QLabel(tr("Lat:")), 0 , 0 );
    fromGrid->addWidget( fromLat, 0, 1 );
    fromGrid->setColumnMinimumWidth( 2, 10 );
    fromGrid->addWidget( new QLabel(tr("Lon:")), 0 , 3 );
    fromGrid->addWidget( fromLong, 0, 4 );
    fromGrid->setColumnStretch( 5, 10 );

    fromGroup = new QGroupBox( tr("Area From") );
    fromGroup->setLayout( fromGrid );

    //---------------------------------------------------------------------------
    toLat  = new LatEdit;
    toLong = new LongEdit;

    QGridLayout* toGrid = new QGridLayout;
    toGrid->setSpacing( 10 );
    toGrid->addWidget( new QLabel(tr("Lat:")), 0 , 0 );
    toGrid->addWidget( toLat, 0, 1 );
    toGrid->setColumnMinimumWidth( 2, 10 );
    toGrid->addWidget( new QLabel(tr("Lon:")), 0 , 3 );
    toGrid->addWidget( toLong, 0, 4 );
    toGrid->setColumnStretch( 5, 10 );

    toGroup = new QGroupBox( tr("Area to") );
    toGroup->setLayout( toGrid );

    //---------------------------------------------------------------------------
    rb0 = new QRadioButton(tr("Position"));
    rb1 = new QRadioButton(tr("Homesite"));
    rb2 = new QRadioButton(tr("Center of Map"));
    rb3 = new QRadioButton(tr("Airfield"));

    QButtonGroup* radiusButtonGroup = new QButtonGroup(this);
    radiusButtonGroup->setExclusive(true);
    radiusButtonGroup->addButton( rb0, CENTER_POS );
    radiusButtonGroup->addButton( rb1, CENTER_HOMESITE );
    radiusButtonGroup->addButton( rb2, CENTER_MAP );
    radiusButtonGroup->addButton( rb3, CENTER_AIRFIELD );

    connect( radiusButtonGroup, SIGNAL( buttonClicked(int)),
             this, SLOT(selectRadius(int)) );

    centerLat  = new LatEdit;
    centerLong = new LongEdit;
    airfieldRefBox = new QComboBox;
    radiusUnit = new QLabel;

    connect( airfieldRefBox, SIGNAL(currentIndexChanged(const QString&)),
             this, SLOT(slotAirfieldRefChanged(const QString&)) );

    radius = new QComboBox;
    radius->setEditable( true );
    radius->setValidator( new QIntValidator(1, 10000, this) );
    QStringList itemList;
    itemList << tr("Off") << "10" << "25" << "50" << "100" << "250" << "500"
             << "750" << "1000" << "1500" << "2000";
    radius->addItems( itemList );
    radius->setCurrentIndex( 5 );

    connect( radius, SIGNAL(currentIndexChanged(int)), SLOT(slotRadiusChanged(int)) );

    QGridLayout *radiusGrid = new QGridLayout;
    radiusGrid->setSpacing(10);
    radiusGrid->addWidget( rb0, 0, 0 );
    radiusGrid->addWidget( new QLabel(tr("Lat:")), 0, 1 );
    radiusGrid->addWidget( centerLat, 0, 2);
    radiusGrid->addWidget( new QLabel(tr("Lon:")), 0, 3 );
    radiusGrid->addWidget( centerLong, 0, 4 );

    radiusGrid->addWidget( rb1, 1, 0 );
    radiusGrid->addWidget( rb2, 2, 0 );
    radiusGrid->addWidget( rb3, 3, 0 );
    radiusGrid->addWidget( airfieldRefBox, 3, 2 );

    radiusGrid->addWidget( radiusUnit, 4, 0 );
    radiusGrid->addWidget( radius, 4, 2 );
    radiusGrid->setColumnStretch( 5, 10 );

    radiusGroup = new QGroupBox( tr("Radius") );
    radiusGroup->setLayout( radiusGrid );

    //---------------------------------------------------------------------------
    QHBoxLayout *buttonBox = new QHBoxLayout;

    QPushButton *b = new QPushButton(tr("&Clear"), this);
    connect(b, SIGNAL(clicked()), this, SLOT(slotClear()));
    buttonBox->addWidget(b);
    buttonBox->addStretch( 10 );

    b = new QPushButton(tr("&Ok"), this);
    b->setDefault(true);
    connect(b, SIGNAL(clicked()), this, SLOT(slotOk()));
    buttonBox->addWidget(b);

    b = new QPushButton(tr("&Cancel"), this);
    connect(b, SIGNAL(clicked()), this, SLOT(slotCancel()));
    buttonBox->addWidget(b);

    //---------------------------------------------------------------------------
    QVBoxLayout *ftrBox = new QVBoxLayout;
    ftrBox->addWidget( filterGroup );
    ftrBox->addWidget( fromGroup );
    ftrBox->addWidget( toGroup );
    ftrBox->addWidget( radiusGroup );
    ftrBox->addStretch( 10 );

    QHBoxLayout *hBox = new QHBoxLayout;
    hBox->addWidget( typeGroup );
    hBox->addLayout( ftrBox );

    QVBoxLayout *top = new QVBoxLayout;
    top->addLayout( hBox );
    top->addLayout( buttonBox );

    setLayout( top );

    slotClear();
    slotChangeUseAll();
    selectRadius(CENTER_HOMESITE);
    loadRadiusValue();
}