示例#1
0
void LensAutoFix::registerSettingsWidget()
{
    const int spacing = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing);

    m_settingsWidget   = new QWidget;
    QLabel* const note = new QLabel(i18n("<b>Use Metadata</b> option will parse images' information at "
                                         "queue run-time to find relevant lens features."));
    note->setWordWrap(true);
    note->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);

    d->cameraSelector       = new LensFunCameraSelector();
    DLineWidget* const line = new DLineWidget(Qt::Horizontal);
    d->settingsView         = new LensFunSettings();
    d->cameraSelector->setPassiveMetadataUsage(true);
    d->cameraSelector->setEnabledUseMetadata(true);

    QGridLayout* const grid = new QGridLayout(m_settingsWidget);
    grid->addWidget(note,              0, 0, 1, 2);
    grid->addWidget(d->cameraSelector, 1, 0, 1, 2);
    grid->addWidget(line,              2, 0, 1, 2);
    grid->addWidget(d->settingsView,   3, 0, 1, 2);
    grid->setRowStretch(4, 10);
    grid->setContentsMargins(spacing, spacing, spacing, spacing);
    grid->setSpacing(spacing);

    connect(d->settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    connect(d->cameraSelector, SIGNAL(signalLensSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#2
0
void ColorFX::registerSettingsWidget()
{
    m_settingsWidget = new QWidget;
    m_settingsView   = new ColorFXSettings(m_settingsWidget);
    m_settingsView->resetToDefault();

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    connect(m_settingsView, SIGNAL(signalLevelOrIterationChanged()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#3
0
MainWindow::MainWindow(QWidget* parent, const char* name, WFlags fl)
//     : KMainWindow(parent, name, fl),  m_debuggerSettings(0), m_browserSettings(0)
    : KParts::MainWindow(parent, name, fl),  m_debuggerSettings(0), m_browserSettings(0)
{
  if(!name) { setName("MainWindow"); }

  setupStatusBar();

  m_debugger_manager = new DebuggerManager(this);

  createWidgets();

  setupActions();

  createGUI(0);

  resize( QSize(633, 533).expandedTo(minimumSizeHint()) );
  clearWState(WState_Polished);

  m_debugger_manager->init();

  connect(kapp, SIGNAL(aboutToQuit()), this, SLOT(slotClose()));

  connect(ProtoeditorSettings::self(), SIGNAL(sigSettingsChanged()),
          this, SLOT(slotSettingsChanged()));

  loadSites();

  stateChanged("init");
}
LauncherApplet::LauncherApplet(SessionAppletDef * appletDef,
                               const QString & id,  LauncherPlugin * plugin)
    : SessionApplet(appletDef, id),
      _plugin(plugin), _fileItem(0)
{
    _button = new LauncherButton();
    _button->popupMenu()->insertItem( i18n("&Preferences"), this, SLOT(slotShowPreferences()));
    _button->popupMenu()->insertItem( i18n("&Remove"), this, SLOT(slotRemove()));

    connect(_plugin, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged()));
    connect(_button, SIGNAL(clicked()), this, SLOT(slotButtonClicked()));
    
    _icon = _button;
    
    slotSettingsChanged();
}
示例#5
0
ChannelMixer::ChannelMixer(QObject* parent)
    : BatchTool("ChannelMixer", ColorTool, parent)
{
    setToolTitle(i18n("Channel Mixer"));
    setToolDescription(i18n("A tool to mix color channel."));
    setToolIcon(KIcon(SmallIcon("channelmixer")));

    KVBox* vbox          = new KVBox;
    KHBox* hbox          = new KHBox(vbox);
    QLabel* channelLabel = new QLabel(hbox);
    channelLabel->setText(i18n("Channel:"));
    m_channelCB          = new KComboBox(hbox);
    m_channelCB->addItem(i18n("Red"),   QVariant(RedChannel));
    m_channelCB->addItem(i18n("Green"), QVariant(GreenChannel));
    m_channelCB->addItem(i18n("Blue"),  QVariant(BlueChannel));

    m_settingsView = new MixerSettings(vbox);
    QLabel* space  = new QLabel(vbox);
    vbox->setStretchFactor(space, 10);

    setSettingsWidget(vbox);

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    connect(m_channelCB, SIGNAL(activated(int)),
            this, SLOT(slotChannelChanged()));

    connect(m_settingsView, SIGNAL(signalMonochromeActived(bool)),
            this, SLOT(slotMonochromeActived(bool)));
}
DebuggerPerlDBGP::DebuggerPerlDBGP(LanguageSettings* langs)
    : AbstractDebugger(langs), m_name("perldbgp"), m_isRunning(false), m_isJITActive(false),
      m_listenPort(-1), m_currentExecutionPoint(0), m_globalExecutionPoint(0), 
      m_pdbgSettings(0), m_net(0)
{
  m_pdbgSettings = new PerlDBGPSettings(Protoeditor::self()->settings()->configFile(),
      name(), label(), langSettings());

  langSettings()->registerDebuggerSettings(name(), m_pdbgSettings);

  m_currentExecutionPoint = new DebuggerExecutionPoint();
  m_globalExecutionPoint  = new DebuggerExecutionPoint();


  connect(Protoeditor::self()->settings(), SIGNAL(sigSettingsChanged()),
          this, SLOT(slotSettingsChanged()));

  m_net = new PerlDBGPNet(this);
  connect(m_net, SIGNAL(sigStarted()), this, SLOT(slotStarted()));
  connect(m_net, SIGNAL(sigClosed()), this, SLOT(slotStopped()));
  connect(m_net, SIGNAL(sigError(const QString&)), this, SIGNAL(sigInternalError(const QString&)));
  connect(m_net, SIGNAL(sigStepDone()), this, SLOT(slotStepDone()));
  connect(m_net, SIGNAL(sigNewConnection()), this, SLOT(slotNewConnection()));
  //connect(m_net, SIGNAL(sigBreakpoint()), this, SLOT(slotBreakpoint()));  
}
void LauncherApplet::slotShowPreferences()
{
    // Will delete itself...
    KPropertiesDialog *pDlg = new KPropertiesDialog(_fileItem, 0L, 0L, false, false);
    pDlg->setFileNameReadOnly(true);
    connect(pDlg, SIGNAL(applied()), SLOT(slotSettingsChanged()));
    pDlg->show();
}
void LauncherApplet::restore(KConfigBase * config)
{    
    SessionApplet::restore(config);
    
    _url = KURL(config->readEntry("URL"));
    
    slotSettingsChanged();
}
LauncherApplet::LauncherApplet(SessionAppletDef * appletDef,
                               const QString & id,  LauncherPlugin * plugin)
    : SessionApplet(appletDef, id),
      _plugin(plugin), _fileItem(0)
{
    _button = new LauncherButton();
    addContextAction(new KAction(i18n("&Preferences"), KShortcut(), 
                     this, SLOT(slotShowPreferences()), this, "clockPreferences"));
    // The second last argument of KAction passes an owner applet which gives auto deletion
    // Removing Launcher applets is now handled generally though a slot on the host

    connect(_plugin, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged()));
    connect(_button, SIGNAL(clicked()), this, SLOT(slotButtonClicked()));
    
    setIcon(_button);
    
    slotSettingsChanged();
}
示例#10
0
void StartupSettingsPage::selectHomeUrl()
{
    const QUrl homeUrl(QUrl::fromUserInput(m_homeUrl->text(), QString(), QUrl::AssumeLocalFile));
    QUrl url = QFileDialog::getExistingDirectoryUrl(this, QString(), homeUrl);
    if (!url.isEmpty()) {
        m_homeUrl->setText(url.toDisplayString(QUrl::PreferLocalFile));
        slotSettingsChanged();
    }
}
示例#11
0
void StartupSettingsPage::selectHomeUrl()
{
    const QString homeUrl = m_homeUrl->text();
    KUrl url = KFileDialog::getExistingDirectoryUrl(homeUrl, this);
    if (!url.isEmpty()) {
        m_homeUrl->setText(url.prettyUrl());
        slotSettingsChanged();
    }
}
示例#12
0
void Sharpen::registerSettingsWidget()
{
    m_settingsWidget = new QWidget;
    m_settingsView   = new SharpSettings(m_settingsWidget);

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#13
0
void RedEyeCorrection::registerSettingsWidget()
{
    m_settingsWidget = new QWidget;
    m_settingsView   = new RedEyeCorrectionSettings(m_settingsWidget);

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#14
0
QWidget* Sharpen::createSettingsWidget()
{
    QWidget* box   = new QWidget;
    m_settingsView = new SharpSettings(box);

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    return box;
}
示例#15
0
void Convert2TIFF::registerSettingsWidget()
{
    m_settings       = new TIFFSettings();
    m_settingsWidget = m_settings;

    connect(m_settings, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#16
0
文件: bwconvert.cpp 项目: KDE/digikam
void BWConvert::registerSettingsWidget()
{
    m_settingsWidget = new QWidget;
    m_settingsView   = new BWSepiaSettings(m_settingsWidget, &m_preview);
    m_settingsView->startPreviewFilters();

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#17
0
void FilmGrain::registerSettingsWidget()
{
    m_settingsWidget = new QWidget;
    m_settingsView   = new FilmGrainSettings(m_settingsWidget);
    m_settingsView->resetToDefault();

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#18
0
QWidget* BWConvert::createSettingsWidget()
{
    QWidget* box   = new QWidget;
    m_settingsView = new BWSepiaSettings(box, &m_preview);

    m_settingsView->startPreviewFilters();

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));

    return box;
}
示例#19
0
void AssignTemplate::registerSettingsWidget()
{
    KVBox* const vbox  = new KVBox;
    m_templateSelector = new TemplateSelector(vbox);
    m_templateViewer   = new TemplateViewer(vbox);
    m_settingsWidget   = vbox;

    connect(m_templateSelector, SIGNAL(signalTemplateSelected()),
            this, SLOT(slotSettingsChanged()));

    BatchTool::registerSettingsWidget();
}
示例#20
0
HideButton::HideButton(QWidget *parent, const char *name) : QButton(parent, name), m_highlight(false), m_arrow(Qt::LeftArrow)
{
    setBackgroundOrigin(AncestorOrigin);

    connect(kapp, SIGNAL(settingsChanged(int)), SLOT(slotSettingsChanged(int)));
    connect(kapp, SIGNAL(iconChanged(int)), SLOT(slotIconChanged(int)));

    kapp->addKipcEventMask(KIPC::SettingsChanged);
    kapp->addKipcEventMask(KIPC::IconChanged);

    slotSettingsChanged(KApplication::SETTINGS_MOUSE);
}
示例#21
0
HideButton::HideButton(QWidget *parent)
    : QAbstractButton(parent),
      m_highlight(false),
      m_arrow(Qt::LeftArrow)
{
    setBackgroundOrigin(AncestorOrigin);

    connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), SLOT(slotSettingsChanged(int)));
    connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)), SLOT(slotIconChanged(int)));

    slotSettingsChanged(KGlobalSettings::SETTINGS_MOUSE);
}
示例#22
0
bool VCSPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
    Q_UNUSED(arguments)
    Q_UNUSED(errorMessage)

    Core::ICore *core = Core::ICore::instance();
    if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/vcsbase/VCSBase.mimetypes.xml"), errorMessage))
        return false;

    m_coreListener = new CoreListener;
    addAutoReleasedObject(m_coreListener);

    m_settingsPage = new CommonOptionsPage;
    addAutoReleasedObject(m_settingsPage);
    addAutoReleasedObject(VCSBaseOutputWindow::instance());
    connect(m_settingsPage, SIGNAL(settingsChanged(VCSBase::Internal::CommonVcsSettings)),
            this, SIGNAL(settingsChanged(VCSBase::Internal::CommonVcsSettings)));
    connect(m_settingsPage, SIGNAL(settingsChanged(VCSBase::Internal::CommonVcsSettings)),
            this, SLOT(slotSettingsChanged()));
    slotSettingsChanged();
    return true;
}
示例#23
0
ColorBalance::ColorBalance(QObject* parent)
    : BatchTool("ColorBalance", ColorTool, parent)
{
    setToolTitle(i18n("Color Balance"));
    setToolDescription(i18n("A tool to adjust color balance."));
    setToolIcon(KIcon(SmallIcon("adjustrgb")));

    QWidget* box   = new QWidget;
    m_settingsView = new CBSettings(box);
    setSettingsWidget(box);

    connect(m_settingsView, SIGNAL(signalSettingsChanged()),
            this, SLOT(slotSettingsChanged()));
}
/**
 *  Initialize the applet.
 *
 *  Only called when we create a new applet. Asks the user for an URL and
 *  creates a .desktop file...
 */
bool LauncherApplet::init()
{
    //    
    // Get an url...
    //
    KFileDialog fileDlg(0, 0, 0, 0, true);
    fileDlg.exec();
    _url = fileDlg.selectedURL();
    
    if (!_url.isValid()) {
        return false;
    }
    
    //
    // Create a .desktop file
    //
    QString file = newDesktopFile(_url);
    
    if (KDesktopFile::isDesktopFile(_url.path())) {
        // Copy existing file...
        KURL dest;
        dest.setPath(file);
        KIO::NetAccess::upload(_url.path(), dest, 0);
    } else {
        // Create new file...
        KDesktopFile df(file);
        
        df.writeEntry("Encoding", "UTF-8");
        df.writeEntry("Type","Link");
        df.writeEntry("Name", _url.prettyURL());
        
        if (_url.isLocalFile()) {
            KFileItem item( KFileItem::Unknown, KFileItem::Unknown, _url );
            df.writeEntry("Icon", item.iconName() );
        } else {
            df.writeEntry("Icon", KMimeType::favIconForURL(_url));
        }
        df.writeEntry("URL", _url.url());
        df.sync();
    }
    
    // Use the .desktop file as URL
    _url = KURL();
    _url.setPath(file);
    
    // Update everything...
    slotSettingsChanged();
    
    return true;
}
示例#25
0
KexiBrowser::KexiBrowser(QWidget* parent, KexiMainWindow *mainWin, int features)
 : QWidget(parent, "KexiBrowser")
 , m_mainWin(mainWin)
 , m_features(features)
 , m_actions( new KActionCollection(this) )
 , m_baseItems(199, false)
 , m_normalItems(199)
 , m_prevSelectedPart(0)
 , m_singleClick(false)
// , m_nameEndsWithAsterisk(false)
 , m_readOnly(false)
// , m_enableExecuteArea(true)
{
	setCaption(i18n("Project Navigator"));
	setIcon(*m_mainWin->icon());

	QVBoxLayout *lyr = new QVBoxLayout(this);
	KexiFlowLayout *buttons_flyr = new KexiFlowLayout(lyr);

	m_list = new KexiBrowserListView(this);
	lyr->addWidget(m_list);
	m_list->installEventFilter(this);
	m_list->renameLineEdit()->installEventFilter(this);
	connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) );
	slotSettingsChanged(0);

	m_list->header()->hide();
	m_list->addColumn("");
	m_list->setShowToolTips(true);
	m_list->setSorting(0);
	m_list->sort();
	m_list->setAllColumnsShowFocus(true);
	m_list->setTooltipColumn(0);
	m_list->renameLineEdit()->setValidator( new KexiUtils::IdentifierValidator(this) );
	m_list->setResizeMode(QListView::LastColumn);
	connect(m_list, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint &)),
		this, SLOT(slotContextMenu(KListView*, QListViewItem *, const QPoint&)));
	connect(m_list, SIGNAL(selectionChanged(QListViewItem*)), this,
		SLOT(slotSelectionChanged(QListViewItem*)));
	
	KConfig *config = kapp->config();
	config->setGroup("MainWindow");
	if ((m_features & SingleClickOpensItemOptionEnabled) 
		&& config->readBoolEntry("SingleClickOpensItem", false))
	{
		connect(m_list, SIGNAL(executed(QListViewItem*)), this,
			SLOT(slotExecuteItem(QListViewItem*)));
	}
TextEffectPlugin::TextEffectPlugin( QObject *parent, const char *name, const QStringList &/*args*/ )
: Kopete::Plugin( TextEffectPluginFactory::instance(), parent, name )
{
	if( !pluginStatic_ )
		pluginStatic_=this;

	m_config = new TextEffectConfig;

	connect ( this , SIGNAL( settingsChanged() ) , this , SLOT( slotSettingsChanged() ) );

	connect( Kopete::ChatSessionManager::self(),
		SIGNAL( aboutToSend( Kopete::Message & ) ),
		SLOT( slotOutgoingMessage( Kopete::Message & ) ) );

	 last_color=0;
}
SpotifySettingsDialog::SpotifySettingsDialog( QWidget *parent )
    : KDialog( parent )
    , m_settingsWidget(new Ui::SpotifySettingsWidget)
{
    debug() << "Checking Spotify resolver: " << Collections::SpotifyCollection::resolverPath();
    if( !QFile::exists( Collections::SpotifyCollection::resolverPath() ) )
    {
        SpotifyDownloadDialog dialog;
        m_config.reset();
        dialog.exec();
    }

    setCaption( i18n( "Spotify configuration" ) );
    setButtons( KDialog::Ok | KDialog::Cancel | KDialog::Apply | KDialog::Default );
    enableButtonApply( false );

    QWidget *w = new QWidget(this);
    m_settingsWidget->setupUi( w );
    m_settingsWidget->messageWidget->hide();
    setMainWidget( w );

    connect( this, SIGNAL( okClicked() ),
            this, SLOT( slotTryLogin() ) );
    connect( this, SIGNAL( cancelClicked() ),
            this, SLOT( slotCancel() ) );
    connect( this, SIGNAL( applyClicked() ),
            this, SLOT( slotTryLogin() ) );
    connect( this, SIGNAL( defaultClicked() ),
            this, SLOT( defaults() ) );

    connect( m_settingsWidget->lineUsername, SIGNAL( textChanged( const QString& ) ),
            this, SLOT( slotSettingsChanged() ) );
    connect( m_settingsWidget->linePassword, SIGNAL( textChanged( const QString& ) ),
            this, SLOT( slotSettingsChanged() ) );
    connect( m_settingsWidget->checkHighQuality, SIGNAL( clicked() ),
            this, SLOT( slotSettingsChanged() ) );

    connect( this, SIGNAL( changed( bool ) ), this, SLOT( enableButtonApply( bool ) ) );

    // Load config from KConfig or KWallet
    load();
}
示例#28
0
HistoryPlugin::HistoryPlugin( QObject *parent, const char *name, const QStringList & /* args */ )
: Kopete::Plugin( HistoryPluginFactory::instance(), parent, name ), m_loggerFactory( this )
{
	KAction *viewMetaContactHistory = new KAction( i18n("View &History" ),
		QString::fromLatin1( "history" ), 0, this, SLOT(slotViewHistory()),
		actionCollection(), "viewMetaContactHistory" );
	viewMetaContactHistory->setEnabled(
		Kopete::ContactList::self()->selectedMetaContacts().count() == 1 );

	connect(Kopete::ContactList::self(), SIGNAL(metaContactSelected(bool)),
		viewMetaContactHistory, SLOT(setEnabled(bool)));

	connect(Kopete::ChatSessionManager::self(), SIGNAL(viewCreated(KopeteView*)),
		this, SLOT(slotViewCreated(KopeteView*)));

	connect(this, SIGNAL(settingsChanged()), this, SLOT(slotSettingsChanged()));

	setXMLFile("historyui.rc");
	if(detectOldHistory())
	{
		if(
			KMessageBox::questionYesNo(Kopete::UI::Global::mainWidget(),
				i18n( "Old history files from Kopete 0.6.x or older has been detected.\n"
				"Do you want to import and convert it to the new history format?" ),
				i18n( "History Plugin" ), i18n("Import && Convert"), i18n("Do Not Import") ) == KMessageBox::Yes )
		{
			convertOldHistory();
		}
	}

	// Add GUI action to all existing kmm objects
	// (Needed if the plugin is enabled while kopete is already running)
	QValueList<Kopete::ChatSession*> sessions = Kopete::ChatSessionManager::self()->sessions();
	for (QValueListIterator<Kopete::ChatSession*> it= sessions.begin(); it!=sessions.end() ; ++it)
	{
	  if(!m_loggers.contains(*it))
		{
			m_loggers.insert(*it, new HistoryGUIClient( *it ) );
			connect( *it, SIGNAL(closing(Kopete::ChatSession*)),
				this, SLOT(slotKMMClosed(Kopete::ChatSession*)));
		}
	}
示例#29
0
K3IconView::K3IconView( QWidget *parent, const char *name, Qt::WFlags f )
    : Q3IconView( parent, name, f )
{
    d = new K3IconViewPrivate;

    connect( this, SIGNAL( onViewport() ),
             this, SLOT( slotOnViewport() ) );
    connect( this, SIGNAL( onItem( Q3IconViewItem * ) ),
             this, SLOT( slotOnItem( Q3IconViewItem * ) ) );
    slotSettingsChanged( KGlobalSettings::SETTINGS_MOUSE );
    connect( KGlobalSettings::self(), SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) );

    m_pCurrentItem = 0L;

    m_pAutoSelect = new QTimer( this );
    connect( m_pAutoSelect, SIGNAL( timeout() ),
             this, SLOT( slotAutoSelect() ) );

    connect( &d->dragHoldTimer, SIGNAL(timeout()), this, SLOT(slotDragHoldTimeout()) );
}
示例#30
0
KIconView::KIconView(QWidget *parent, const char *name, WFlags f) : QIconView(parent, name, f)
{
    d = new KIconViewPrivate;

    connect(this, SIGNAL(onViewport()), this, SLOT(slotOnViewport()));
    connect(this, SIGNAL(onItem(QIconViewItem *)), this, SLOT(slotOnItem(QIconViewItem *)));
    slotSettingsChanged(KApplication::SETTINGS_MOUSE);
    if(kapp)
    { // maybe null when used inside designer
        connect(kapp, SIGNAL(settingsChanged(int)), SLOT(slotSettingsChanged(int)));
        kapp->addKipcEventMask(KIPC::SettingsChanged);
    }

    m_pCurrentItem = 0L;

    m_pAutoSelect = new QTimer(this);
    connect(m_pAutoSelect, SIGNAL(timeout()), this, SLOT(slotAutoSelect()));

    connect(&d->dragHoldTimer, SIGNAL(timeout()), this, SLOT(slotDragHoldTimeout()));
}