コード例 #1
0
ファイル: settingsdialog.cpp プロジェクト: marxoft/cutenews
void SettingsDialog::showGeneralTab() {
    if (!m_generalTab) {
        m_generalTab = new QWidget(m_stack);
        m_downloadsCheckBox = new QCheckBox(tr("Start downloads &automatically"), m_generalTab);
        m_downloadsCheckBox->setChecked(Settings::startTransfersAutomatically());
        m_downloadPathEdit = new QLineEdit(Settings::downloadPath(), m_generalTab);
        m_downloadPathButton = new QPushButton(QIcon::fromTheme("document-open"), tr("Browse"), m_generalTab);
        m_expirySpinBox = new QSpinBox(m_generalTab);
        m_expirySpinBox->setSuffix(tr(" day(s)"));
        m_expirySpinBox->setRange(-1, 90);
        m_expirySpinBox->setValue(Settings::readArticleExpiry());
        m_downloadsSpinBox = new QSpinBox(m_generalTab);
        m_downloadsSpinBox->setRange(1, MAX_CONCURRENT_TRANSFERS);
        m_downloadsSpinBox->setValue(Settings::maximumConcurrentTransfers());
        
        QFormLayout *form = new QFormLayout(m_generalTab);
        form->addRow(tr("&Delete read articles older than (-1 to disable):"), m_expirySpinBox);
        form->addRow(tr("Download &path:"), m_downloadPathEdit);
        form->addWidget(m_downloadPathButton);
        form->addRow(tr("&Maximum concurrent downloads:"), m_downloadsSpinBox);
        form->addRow(m_downloadsCheckBox);

        connect(m_expirySpinBox, SIGNAL(valueChanged(int)), Settings::instance(), SLOT(setReadArticleExpiry(int)));
        connect(m_downloadsCheckBox, SIGNAL(toggled(bool)),
                Settings::instance(), SLOT(setStartTransfersAutomatically(bool)));
        connect(m_downloadPathEdit, SIGNAL(textChanged(QString)), Settings::instance(), SLOT(setDownloadPath(QString)));
        connect(m_downloadPathButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));
        connect(m_downloadsSpinBox, SIGNAL(valueChanged(int)),
                Settings::instance(), SLOT(setMaximumConcurrentTransfers(int)));
        
        m_stack->addWidget(m_generalTab);
    }
    
    m_stack->setCurrentWidget(m_generalTab);
}
コード例 #2
0
ファイル: newcategorydialog.cpp プロジェクト: marxoft/qdl
NewCategoryDialog::NewCategoryDialog(QWidget *parent) :
    QDialog(parent),
    m_nameEdit(new QLineEdit(this)),
    m_pathEdit(new QLineEdit(this)),
    m_browseButton(new QPushButton(tr("Browse"), this)),
    m_doneButton(new QPushButton(tr("Done"), this))
{
    this->setWindowTitle(tr("New category"));
    this->setAttribute(Qt::WA_DeleteOnClose, true);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(Qt::Horizontal, this);
    buttonBox->addButton(m_browseButton, QDialogButtonBox::ActionRole);
    buttonBox->addButton(QDialogButtonBox::Cancel);
    buttonBox->addButton(m_doneButton, QDialogButtonBox::AcceptRole);

    QGridLayout *grid = new QGridLayout(this);
    grid->addWidget(new QLabel(tr("Name") + ":", this), 0, 0);
    grid->addWidget(m_nameEdit, 0, 1);
    grid->addWidget(new QLabel(tr("Download path") + ":", this), 1, 0);
    grid->addWidget(m_pathEdit, 1, 1);
    grid->addWidget(buttonBox, 2, 0, 1, 2);

    m_doneButton->setEnabled(false);

    this->connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SLOT(onNameTextChanged(QString)));
    this->connect(m_browseButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));
    this->connect(buttonBox, SIGNAL(accepted()), this, SLOT(addCategory()));
    this->connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
コード例 #3
0
ファイル: timerdialog.cpp プロジェクト: loimu/zeit
TimerDialog::TimerDialog(Commands* commands_, QWidget *parent) : BaseDialog(parent),
    ui(new Ui::TimerDialog),
    commands(commands_)
{
    ui->setupUi(this);
    setWindowTitle(tr("New Timer"));
    // prepopulate fields
    ui->lineEditComment->setText(tr("New Timer"));
    ui->checkBox->setChecked(true);
    // detect player
    QProcess proc;
    proc.start(QStringLiteral("which"), QStringList{QStringLiteral("mpv"),
                                                    QStringLiteral("mplayer")});
    proc.waitForFinished(-1);
    QStringList players = QString::fromUtf8(
                proc.readAllStandardOutput()).split(QRegExp(QStringLiteral("\n")));
    if(players.length() > 0)
        ui->lineEditPlayer->setText(players.at(0));
    // get system time with a positive offset of 5 minutes
    QTime time = QTime::currentTime().addSecs(60 * 5);
    ui->spinBoxHours->setValue(time.hour());
    ui->spinBoxMinutes->setValue(time.minute());
    // FileDialog actions
    connect(ui->pushButtonSoundFile, SIGNAL(released()), SLOT(showFileDialog()));
    connect(ui->pushButtonPlayer, SIGNAL(released()), SLOT(showPlayerDialog()));
    ui->pushButtonPlayer->setIcon(QIcon::fromTheme(
                                      QStringLiteral("document-open")));
    ui->pushButtonSoundFile->setIcon(QIcon::fromTheme(
                                         QStringLiteral("document-open")));
}
コード例 #4
0
 TOPPASOutputFilesDialog::TOPPASOutputFilesDialog(const QString & dir_name, int num_jobs)
 {
   setupUi(this);
   if (dir_name != "")
   {
     line_edit->setText(dir_name);
   }
   else
   {
     line_edit->setText(QDir::currentPath());
   }
   if (num_jobs >= 1)
   {
     num_jobs_box->setValue(num_jobs);
   }
   QCompleter * completer = new QCompleter(this);
   QDirModel * dir_model = new QDirModel(completer);
   dir_model->setFilter(QDir::AllDirs);
   completer->setModel(dir_model);
   line_edit->setCompleter(completer);
   connect(browse_button, SIGNAL(clicked()), this, SLOT(showFileDialog()));
   connect(ok_button, SIGNAL(clicked()), this, SLOT(checkValidity_()));
   connect(cancel_button, SIGNAL(clicked()), this, SLOT(reject()));
   
   // make Ok the default (just pressing Enter will run the workflow)
   ok_button->setFocus();
 }
コード例 #5
0
ファイル: image.cpp プロジェクト: mgottschlag/kwin-tiling
QWidget* Image::createConfigurationInterface(QWidget* parent)
{
    m_configWidget = new QWidget(parent);
    connect(m_configWidget, SIGNAL(destroyed(QObject*)), this, SLOT(configWidgetDestroyed()));

    if (m_mode == "SingleImage") {
        m_uiImage.setupUi(m_configWidget);

        m_model = new BackgroundListModel(this, m_configWidget);
        m_model->setResizeMethod(resizeMethodHint());
        m_model->setWallpaperSize(m_size);
        m_model->reload(m_usersWallpapers);
        QTimer::singleShot(0, this, SLOT(setConfigurationInterfaceModel()));
        m_uiImage.m_view->setItemDelegate(new BackgroundDelegate(m_uiImage.m_view));
        //FIXME: setting the minimum width is rather ugly, but this gets us 3 columns of papers
        //which looks quite good as a default. the magic number 7 at the end of the calculation is
        //evidently making up for some other PM involved in the QListView that isn't being caught.
        //if a cleaner way can be found to achieve all this, that would be great
        m_uiImage.m_view->setMinimumWidth((BackgroundDelegate::SCREENSHOT_SIZE + BackgroundDelegate::MARGIN * 2 +
                                           BackgroundDelegate::BLUR_INCREMENT) * 3 +
                                           m_uiImage.m_view->spacing() * 4 +
                                           QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent) +
                                           QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth) * 2 + 7);
        m_uiImage.m_view->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

        RemoveButtonManager *rmManager = new RemoveButtonManager(m_uiImage.m_view, &m_usersWallpapers);
        connect(rmManager, SIGNAL(removeClicked(QString)), this, SLOT(removeWallpaper(QString)));

        m_uiImage.m_pictureUrlButton->setIcon(KIcon("document-open"));
        connect(m_uiImage.m_pictureUrlButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));

        m_uiImage.m_resizeMethod->addItem(i18n("Scaled & Cropped"), ScaledAndCroppedResize);
        m_uiImage.m_resizeMethod->addItem(i18n("Scaled"), ScaledResize);
        m_uiImage.m_resizeMethod->addItem(i18n("Scaled, keep proportions"), MaxpectResize);
        m_uiImage.m_resizeMethod->addItem(i18n("Centered"), CenteredResize);
        m_uiImage.m_resizeMethod->addItem(i18n("Tiled"), TiledResize);
        m_uiImage.m_resizeMethod->addItem(i18n("Center Tiled"), CenterTiledResize);
        for (int i = 0; i < m_uiImage.m_resizeMethod->count(); ++i) {
            if (resizeMethodHint() == m_uiImage.m_resizeMethod->itemData(i).value<int>()) {
                m_uiImage.m_resizeMethod->setCurrentIndex(i);
                break;
            }
        }
        connect(m_uiImage.m_resizeMethod, SIGNAL(currentIndexChanged(int)),
                this, SLOT(positioningChanged(int)));

        m_uiImage.m_color->setColor(m_color);
        //Color button is useless with some resize methods
        m_uiImage.m_color->setEnabled(resizeMethodHint() == MaxpectResize || resizeMethodHint() == CenteredResize);
        connect(m_uiImage.m_color, SIGNAL(changed(QColor)), this, SLOT(colorChanged(QColor)));

        m_uiImage.m_newStuff->setIcon(KIcon("get-hot-new-stuff"));
        connect(m_uiImage.m_newStuff, SIGNAL(clicked()), this, SLOT(getNewWallpaper()));

        connect(m_uiImage.m_color, SIGNAL(changed(QColor)), this, SLOT(modified()));
        connect(m_uiImage.m_resizeMethod, SIGNAL(currentIndexChanged(int)), this, SLOT(modified()));
        connect(m_uiImage.m_view, SIGNAL(clicked(QModelIndex)), this, SLOT(modified()));

    } else {
コード例 #6
0
ファイル: new_map_dialog.cpp プロジェクト: sikmir/mapper
void NewMapDialog::createClicked()
{
	QListWidgetItem* item = symbol_set_list->currentItem();
	if (item == load_from_file)
		showFileDialog();
	else
		accept();
}
コード例 #7
0
ファイル: new_map_dialog.cpp プロジェクト: sikmir/mapper
void NewMapDialog::symbolSetDoubleClicked(QListWidgetItem* item)
{
	symbol_set_list->setCurrentItem(item);
	if (item == load_from_file)
		showFileDialog();
	else
		accept();
}
コード例 #8
0
ファイル: soundkonverter.cpp プロジェクト: EQ4/soundkonverter
void soundKonverter::setupActions()
{
    KStandardAction::quit( this, SLOT(close()), actionCollection() );
    KStandardAction::preferences( this, SLOT(showConfigDialog()), actionCollection() );

    KAction *logviewer = actionCollection()->addAction("logviewer");
    logviewer->setText(i18n("View logs..."));
    logviewer->setIcon(KIcon("view-list-text"));
    connect( logviewer, SIGNAL(triggered()), this, SLOT(showLogViewer()) );

    KAction *replaygainscanner = actionCollection()->addAction("replaygainscanner");
    replaygainscanner->setText(i18n("Replay Gain tool..."));
    replaygainscanner->setIcon(KIcon("soundkonverter-replaygain"));
    connect( replaygainscanner, SIGNAL(triggered()), this, SLOT(showReplayGainScanner()) );

    KAction *aboutplugins = actionCollection()->addAction("aboutplugins");
    aboutplugins->setText(i18n("About plugins..."));
    aboutplugins->setIcon(KIcon("preferences-plugin"));
    connect( aboutplugins, SIGNAL(triggered()), this, SLOT(showAboutPlugins()) );

    KAction *add_files = actionCollection()->addAction("add_files");
    add_files->setText(i18n("Add files..."));
    add_files->setIcon(KIcon("audio-x-generic"));
    connect( add_files, SIGNAL(triggered()), m_view, SLOT(showFileDialog()) );

    KAction *add_folder = actionCollection()->addAction("add_folder");
    add_folder->setText(i18n("Add folder..."));
    add_folder->setIcon(KIcon("folder"));
    connect( add_folder, SIGNAL(triggered()), m_view, SLOT(showDirDialog()) );

    KAction *add_audiocd = actionCollection()->addAction("add_audiocd");
    add_audiocd->setText(i18n("Add CD tracks..."));
    add_audiocd->setIcon(KIcon("media-optical-audio"));
    connect( add_audiocd, SIGNAL(triggered()), m_view, SLOT(showCdDialog()) );

    KAction *add_url = actionCollection()->addAction("add_url");
    add_url->setText(i18n("Add url..."));
    add_url->setIcon(KIcon("network-workgroup"));
    connect( add_url, SIGNAL(triggered()), m_view, SLOT(showUrlDialog()) );

    KAction *add_playlist = actionCollection()->addAction("add_playlist");
    add_playlist->setText(i18n("Add playlist..."));
    add_playlist->setIcon(KIcon("view-media-playlist"));
    connect( add_playlist, SIGNAL(triggered()), m_view, SLOT(showPlaylistDialog()) );

    KAction *load = actionCollection()->addAction("load");
    load->setText(i18n("Load file list"));
    load->setIcon(KIcon("document-open"));
    connect( load, SIGNAL(triggered()), m_view, SLOT(loadFileList()) );

    KAction *save = actionCollection()->addAction("save");
    save->setText(i18n("Save file list"));
    save->setIcon(KIcon("document-save"));
    connect( save, SIGNAL(triggered()), m_view, SLOT(saveFileList()) );

    actionCollection()->addAction("start", m_view->start());
    actionCollection()->addAction("stop_menu", m_view->stopMenu());
}
コード例 #9
0
void ReplayGainScanner::addClicked( int index )
{
    if( index == 1 )
    {
        showFileDialog();
    }
    else
    {
        showDirDialog();
    }
}
コード例 #10
0
GlobalSettingsDialog::GlobalSettingsDialog(QWidget* parent)
    : QDialog(parent)
{
    this->setupUi(this);

    // Set the lineEdit's text to the application's path
    lineEditPath->setText(QCoreApplication::applicationDirPath() +
        QDir::separator() + "results.txt");

    // Connect the browse button to its corresponding slot
    connect(pushButtonBrowse, SIGNAL(clicked()), this, SLOT(showFileDialog()));
}
コード例 #11
0
ファイル: DonationWizard.cpp プロジェクト: LukyLuke/PiTres
DonationWizard::DonationWizard(QWidget *parent) : QDialog(parent) {
	setupUi(this);
	
	connect(btnImportBack, SIGNAL(clicked()), this, SLOT(wizardBack()));
	connect(btnImportNext, SIGNAL(clicked()), this, SLOT(wizardNext()));
	connect(btnImportSave, SIGNAL(clicked()), this, SLOT(wizardNext()));
	
	connect(btnChooseDonationImport, SIGNAL(clicked()), this, SLOT(showFileDialog()));
	connect(actionReloadImportfile, SIGNAL(triggered()), this, SLOT(reloadImport()));
	
	Section::getSectionList(&sectionsList);
	
	enableWizardButtons();
}
コード例 #12
0
ファイル: generalsettingspage.cpp プロジェクト: marxoft/qdl2
GeneralSettingsPage::GeneralSettingsPage(QWidget *parent) :
    SettingsPage(parent),
    m_passwordModel(new ArchivePasswordModel(this)),
    m_pathEdit(new QLineEdit(this)),
    m_commandEdit(new QLineEdit(this)),
    m_passwordEdit(new QLineEdit(this)),
    m_pathButton(new QPushButton(QIcon::fromTheme("document-open"), tr("&Browse"), this)),
    m_passwordButton(new QPushButton(QIcon::fromTheme("list-add"), tr("&Add"), this)),
    m_concurrentSpinBox(new QSpinBox(this)),
    m_commandCheckBox(new QCheckBox(tr("&Enable custom command"), this)),
    m_extractCheckBox(new QCheckBox(tr("&Extract archives"), this)),
    m_deleteCheckBox(new QCheckBox(tr("&Delete extracted archives"), this)),
    m_passwordView(new QListView(this)),
    m_layout(new QFormLayout(this))
{
    setWindowTitle(tr("General"));

    m_passwordButton->setEnabled(false);

    m_concurrentSpinBox->setRange(1, MAX_CONCURRENT_TRANSFERS);

    m_passwordView->setModel(m_passwordModel);
    m_passwordView->setContextMenuPolicy(Qt::CustomContextMenu);

    m_layout->addRow(tr("Download &path:"), m_pathEdit);
    m_layout->addWidget(m_pathButton);
    m_layout->addRow(tr("&Maximum concurrent downloads:"), m_concurrentSpinBox);
    m_layout->addRow(tr("&Custom command (%f for filename):"), m_commandEdit);
    m_layout->addRow(m_commandCheckBox);
    m_layout->addRow(m_extractCheckBox);
    m_layout->addRow(m_deleteCheckBox);
    m_layout->addRow(new QLabel(tr("Archive passwords:"), this));
    m_layout->addRow(m_passwordView);
    m_layout->addRow(tr("Add &password:"), m_passwordEdit);
    m_layout->addWidget(m_passwordButton);

    connect(m_passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(onPasswordChanged(QString)));
    connect(m_passwordEdit, SIGNAL(returnPressed()), m_passwordButton, SLOT(animateClick()));
    connect(m_pathButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));
    connect(m_passwordButton, SIGNAL(clicked()), this, SLOT(addPassword()));
    connect(m_passwordView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showPasswordContextMenu(QPoint)));

    restore();
}
コード例 #13
0
ファイル: categoriesdialog.cpp プロジェクト: marxoft/qdl2
CategoriesDialog::CategoriesDialog(QWidget *parent) :
    QDialog(parent),
    m_model(new CategoryModel(this)),
    m_view(new QTreeView(this)),
    m_nameEdit(new QLineEdit(this)),
    m_pathButton(new QMaemo5ValueButton(tr("Download path"), this)),
    m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Vertical, this)),
    m_layout(new QGridLayout(this))
{
    setWindowTitle(tr("Categories"));
    setMinimumHeight(360);

    m_view->setModel(m_model);
    m_view->setSelectionBehavior(QTreeView::SelectRows);
    m_view->setContextMenuPolicy(Qt::CustomContextMenu);
    m_view->setEditTriggers(QTreeView::NoEditTriggers);
    m_view->setItemsExpandable(false);
    m_view->setUniformRowHeights(true);
    m_view->setAllColumnsShowFocus(true);
    m_view->setRootIsDecorated(false);
    m_view->header()->setStretchLastSection(true);

    m_nameEdit->setPlaceholderText(tr("Name"));

    m_pathButton->setValueText(tr("None chosen"));

    m_buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);

    m_layout->addWidget(m_view, 0, 0);
    m_layout->addWidget(m_nameEdit, 1, 0);
    m_layout->addWidget(m_pathButton, 2, 0);
    m_layout->addWidget(m_buttonBox, 2, 1);
    m_layout->setRowStretch(0, 1);

    connect(m_view, SIGNAL(clicked(QModelIndex)), this, SLOT(setCurrentCategory(QModelIndex)));
    connect(m_view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
    connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SLOT(onNameChanged(QString)));
    connect(m_nameEdit, SIGNAL(returnPressed()), m_buttonBox->button(QDialogButtonBox::Ok), SLOT(animateClick()));
    connect(m_pathButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));
    connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(addCategory()));
}
コード例 #14
0
CategorySettingsPage::CategorySettingsPage(QWidget *parent) :
    SettingsPage(parent),
    m_model(new CategoryModel(this)),
    m_view(new QTreeView(this)),
    m_nameEdit(new QLineEdit(this)),
    m_pathEdit(new QLineEdit(this)),
    m_pathButton(new QPushButton(QIcon::fromTheme("document-open"), tr("&Browse"), this)),
    m_saveButton(new QPushButton(QIcon::fromTheme("document-save"), tr("&Save"), this)),
    m_layout(new QFormLayout(this))
{
    setWindowTitle(tr("Categories"));

    m_view->setModel(m_model);
    m_view->setAlternatingRowColors(true);
    m_view->setSelectionBehavior(QTreeView::SelectRows);
    m_view->setContextMenuPolicy(Qt::CustomContextMenu);
    m_view->setEditTriggers(QTreeView::NoEditTriggers);
    m_view->setItemsExpandable(false);
    m_view->setUniformRowHeights(true);
    m_view->setAllColumnsShowFocus(true);
    m_view->setRootIsDecorated(false);
    m_view->header()->setStretchLastSection(true);

    m_saveButton->setEnabled(false);

    m_layout->addRow(m_view);
    m_layout->addRow(tr("&Name:"), m_nameEdit);
    m_layout->addRow(tr("&Path:"), m_pathEdit);
    m_layout->addWidget(m_pathButton);
    m_layout->addWidget(m_saveButton);

    connect(m_view, SIGNAL(clicked(QModelIndex)), this, SLOT(setCurrentCategory(QModelIndex)));
    connect(m_view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
    connect(m_nameEdit, SIGNAL(textChanged(QString)), this, SLOT(onNameChanged(QString)));
    connect(m_nameEdit, SIGNAL(returnPressed()), m_saveButton, SLOT(animateClick()));
    connect(m_pathEdit, SIGNAL(textChanged(QString)), this, SLOT(onPathChanged(QString)));
    connect(m_pathEdit, SIGNAL(returnPressed()), m_saveButton, SLOT(animateClick()));
    connect(m_pathButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));
    connect(m_saveButton, SIGNAL(clicked()), this, SLOT(addCategory()));
}
コード例 #15
0
void soundKonverterView::addClicked( int index )
{
    if( index == 0 )
    {
        showFileDialog();
    }
    else if( index == 1 )
    {
        showDirDialog();
    }
    else if( index == 2 )
    {
        showCdDialog();
    }
    else if( index == 3 )
    {
        showUrlDialog();
    }
    else
    {
        showPlaylistDialog();
    }
}
コード例 #16
0
 String                  showFileSaveDialog  (const String& title, const String& filters = "", const String& initialDir = "", bool forceInitialDir = false) { return showFileDialog(title, true, filters, initialDir, forceInitialDir); }
コード例 #17
0
ファイル: sf2_player.cpp プロジェクト: AHudon/lmms
sf2InstrumentView::sf2InstrumentView( Instrument * _instrument, QWidget * _parent ) :
	InstrumentView( _instrument, _parent )
{
//	QVBoxLayout * vl = new QVBoxLayout( this );
//	QHBoxLayout * hl = new QHBoxLayout();

	sf2Instrument* k = castModel<sf2Instrument>();

	connect( &k->m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) );
	connect( &k->m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) );

	// File Button
	m_fileDialogButton = new pixmapButton( this );
	m_fileDialogButton->setCursor( QCursor( Qt::PointingHandCursor ) );
	m_fileDialogButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fileselect_on" ) );
	m_fileDialogButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fileselect_off" ) );
	m_fileDialogButton->move( 217, 107 );

	connect( m_fileDialogButton, SIGNAL( clicked() ), this, SLOT( showFileDialog() ) );

	toolTip::add( m_fileDialogButton, tr( "Open other SoundFont file" ) );

	m_fileDialogButton->setWhatsThis( tr( "Click here to open another SF2 file" ) );

	// Patch Button
	m_patchDialogButton = new pixmapButton( this );
	m_patchDialogButton->setCursor( QCursor( Qt::PointingHandCursor ) );
	m_patchDialogButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "patches_on" ) );
	m_patchDialogButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "patches_off" ) );
	m_patchDialogButton->setEnabled( false );
	m_patchDialogButton->move( 217, 125 );

	connect( m_patchDialogButton, SIGNAL( clicked() ), this, SLOT( showPatchDialog() ) );

	toolTip::add( m_patchDialogButton, tr( "Choose the patch" ) );


	// LCDs
	m_bankNumLcd = new LcdSpinBox( 3, "21pink", this );
	m_bankNumLcd->move(131, 62);
//	m_bankNumLcd->addTextForValue( -1, "---" );
//	m_bankNumLcd->setEnabled( false );

	m_patchNumLcd = new LcdSpinBox( 3, "21pink", this );
	m_patchNumLcd->move(190, 62);
//	m_patchNumLcd->addTextForValue( -1, "---" );
//	m_patchNumLcd->setEnabled( false );

	/*hl->addWidget( m_fileDialogButton );
	hl->addWidget( m_bankNumLcd );
	hl->addWidget( m_patchNumLcd );
	hl->addWidget( m_patchDialogButton );

	vl->addLayout( hl );*/

	// Next row

	//hl = new QHBoxLayout();

	m_filenameLabel = new QLabel( this );
	m_filenameLabel->setGeometry( 58, 109, 156, 11 );
	m_patchLabel = new QLabel( this );
	m_patchLabel->setGeometry( 58, 127, 156, 11 );

	//hl->addWidget( m_filenameLabel );
//	vl->addLayout( hl );

	// Gain
	m_gainKnob = new sf2Knob( this );
	m_gainKnob->setHintText( tr("Gain") + " ", "" );
	m_gainKnob->move( 86, 55 );
//	vl->addWidget( m_gainKnob );

	// Reverb
//	hl = new QHBoxLayout();


	m_reverbButton = new pixmapButton( this );
	m_reverbButton->setCheckable( true );
	m_reverbButton->move( 14, 180 );
	m_reverbButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "reverb_on" ) );
	m_reverbButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "reverb_off" ) );
	toolTip::add( m_reverbButton, tr( "Apply reverb (if supported)" ) );
	m_reverbButton->setWhatsThis(
		tr( "This button enables the reverb effect. "
			"This is useful for cool effects, but only works on "
			"files that support it." ) );


	m_reverbRoomSizeKnob = new sf2Knob( this );
	m_reverbRoomSizeKnob->setHintText( tr("Reverb Roomsize:") + " ", "" );
	m_reverbRoomSizeKnob->move( 93, 160 );

	m_reverbDampingKnob = new sf2Knob( this );
	m_reverbDampingKnob->setHintText( tr("Reverb Damping:") + " ", "" );
	m_reverbDampingKnob->move( 130, 160 );

	m_reverbWidthKnob = new sf2Knob( this );
	m_reverbWidthKnob->setHintText( tr("Reverb Width:") + " ", "" );
	m_reverbWidthKnob->move( 167, 160 );

	m_reverbLevelKnob = new sf2Knob( this );
	m_reverbLevelKnob->setHintText( tr("Reverb Level:") + " ", "" );
	m_reverbLevelKnob->move( 204, 160 );

/*	hl->addWidget( m_reverbOnLed );
	hl->addWidget( m_reverbRoomSizeKnob );
	hl->addWidget( m_reverbDampingKnob );
	hl->addWidget( m_reverbWidthKnob );
	hl->addWidget( m_reverbLevelKnob );

	vl->addLayout( hl );
*/

	// Chorus
//	hl = new QHBoxLayout();

	m_chorusButton = new pixmapButton( this );
	m_chorusButton->setCheckable( true );
	m_chorusButton->move( 14, 226 );
	m_chorusButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "chorus_on" ) );
	m_chorusButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "chorus_off" ) );
	toolTip::add( m_reverbButton, tr( "Apply chorus (if supported)" ) );
	m_chorusButton->setWhatsThis(
		tr( "This button enables the chorus effect. "
			"This is useful for cool echo effects, but only works on "
			"files that support it." ) );

	m_chorusNumKnob = new sf2Knob( this );
	m_chorusNumKnob->setHintText( tr("Chorus Lines:") + " ", "" );
	m_chorusNumKnob->move( 93, 206 );

	m_chorusLevelKnob = new sf2Knob( this );
	m_chorusLevelKnob->setHintText( tr("Chorus Level:") + " ", "" );
	m_chorusLevelKnob->move( 130 , 206 );

	m_chorusSpeedKnob = new sf2Knob( this );
	m_chorusSpeedKnob->setHintText( tr("Chorus Speed:") + " ", "" );
	m_chorusSpeedKnob->move( 167 , 206 );

	m_chorusDepthKnob = new sf2Knob( this );
	m_chorusDepthKnob->setHintText( tr("Chorus Depth:") + " ", "" );
	m_chorusDepthKnob->move( 204 , 206 );
/*
	hl->addWidget( m_chorusOnLed );
	hl->addWidget( m_chorusNumKnob);
	hl->addWidget( m_chorusLevelKnob);
	hl->addWidget( m_chorusSpeedKnob);
	hl->addWidget( m_chorusDepthKnob);

	vl->addLayout( hl );
*/
	setAutoFillBackground( true );
	QPalette pal;
	pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
	setPalette( pal );

	updateFilename();

}
コード例 #18
0
void WeatherWallpaper::showAdvancedDialog()
{
    if (m_advancedDialog == 0) {
        m_advancedDialog = new KDialog;
        m_advancedUi.setupUi(m_advancedDialog->mainWidget());
        m_advancedDialog->mainWidget()->layout()->setMargin(0);

        m_advancedDialog->setCaption(i18n("Advanced Wallpaper Settings"));
        m_advancedDialog->setButtons(KDialog::Ok | KDialog::Cancel);

        qreal ratio = m_size.isEmpty() ? 1.0 : m_size.width() / qreal(m_size.height());
        m_model = new BackgroundListModel(ratio, this, m_advancedDialog);
        m_model->setResizeMethod(m_resizeMethod);
        m_model->setWallpaperSize(m_size);
        m_model->reload(m_usersWallpapers);
        m_advancedUi.m_wallpaperView->setModel(m_model);
        m_advancedUi.m_wallpaperView->setItemDelegate(new BackgroundDelegate(m_advancedUi.m_wallpaperView->view(),
                                                                             ratio, m_advancedDialog));
        m_advancedUi.m_wallpaperView->view()->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

        connect(m_advancedUi.m_conditionCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(conditionChanged(int)));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clear" )), i18nc("weather condition", "Clear"), QLatin1String( "weather-clear" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-few-clouds" )), i18n("Partly Cloudy"), QLatin1String( "weather-few-clouds" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clouds") ), i18n("Cloudy"), QLatin1String( "weather-clouds") );
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-many-clouds") ), i18n("Very Cloudy"), QLatin1String( "weather-many-clouds") );
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-showers") ), i18n("Showering"), QLatin1String( "weather-showers") );
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-showers-scattered") ), i18n("Scattered Showers"), QLatin1String( "weather-showers-scattered" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-showers") ), i18n("Rainy"), QLatin1String( "weather-rain") );
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-mist") ), i18n("Misty"), QLatin1String( "weather-mist") );
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-storm") ), i18n("Storming"), QLatin1String( "weather-storm" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-hail") ), i18n("Hailing"), QLatin1String( "weather-hail" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-snow") ), i18n("Snowing"), QLatin1String( "weather-snow" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-snow-scattered") ), i18n("Scattered Snow"), QLatin1String( "weather-snow-scattered" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-few-clouds-night") ), i18n("Partly Cloudy Night"), QLatin1String( "weather-few-clouds-night" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clouds-night") ), i18n("Cloudy Night"), QLatin1String( "weather-clouds-night" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-clear-night") ), i18n("Clear Night"), QLatin1String( "weather-clear-night" ));
        m_advancedUi.m_conditionCombo->addItem(KIcon(QLatin1String( "weather-snow-rain") ), i18n("Mixed Precipitation"), QLatin1String( "weather-snow-rain" ));
        // Set to the current weather condition
        m_advancedUi.m_conditionCombo->setCurrentIndex(m_advancedUi.m_conditionCombo->findData(m_condition));


        connect(m_advancedUi.m_wallpaperView, SIGNAL(currentIndexChanged(int)), this, SLOT(pictureChanged(int)));

        m_advancedUi.m_pictureUrlButton->setIcon(KIcon(QLatin1String( "document-open" )));
        connect(m_advancedUi.m_pictureUrlButton, SIGNAL(clicked()), this, SLOT(showFileDialog()));

        m_advancedUi.m_emailLine->setTextInteractionFlags(Qt::TextSelectableByMouse);

        m_advancedUi.m_resizeMethod->addItem(i18n("Scaled & Cropped"), ScaledAndCroppedResize);
        m_advancedUi.m_resizeMethod->addItem(i18n("Scaled"), ScaledResize);
        m_advancedUi.m_resizeMethod->addItem(i18n("Scaled, keep proportions"), MaxpectResize);
        m_advancedUi.m_resizeMethod->addItem(i18n("Centered"), CenteredResize);
        m_advancedUi.m_resizeMethod->addItem(i18n("Tiled"), TiledResize);
        m_advancedUi.m_resizeMethod->addItem(i18n("Center Tiled"), CenterTiledResize);
        for (int i = 0; i < m_advancedUi.m_resizeMethod->count(); ++i) {
            if (m_resizeMethod == m_advancedUi.m_resizeMethod->itemData(i).value<int>()) {
                m_advancedUi.m_resizeMethod->setCurrentIndex(i);
                break;
            }
        }
        connect(m_advancedUi.m_resizeMethod, SIGNAL(currentIndexChanged(int)),
                this, SLOT(positioningChanged(int)));

        m_advancedUi.m_color->setColor(m_color);
        m_advancedUi.m_newStuff->setIcon(KIcon(QLatin1String( "get-hot-new-stuff" )));
        connect(m_advancedUi.m_color, SIGNAL(changed(QColor)), this, SLOT(colorChanged(QColor)));
    }