Exemple #1
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 TaskWidgetItem::TaskWidgetItem::editTask()
{

    qDebug() << (int)parentWidget()->geometry().width();
    
    m_editor = new TaskEditor();

    m_editor->setAllDay(m_todo->allDay());

    if (m_todo->hasStartDate()) {

        m_editor->setStartDate(m_todo->dtStart());

    } else {

        m_editor->disableStartDate();

        if (m_todo->hasDueDate()) {

            if (m_todo->dtDue().date() < QDate::currentDate()) {

                m_editor->setStartDate(m_todo->dtDue());

            }

        }

    }

    if (m_todo->hasDueDate()) {

        m_editor->setDueDate(m_todo->dtDue());

    } else {

        m_editor->disableDueDate();

    }

    m_editor->setName(m_todo->summary());
    m_editor->setDescription(m_todo->description());

    KDialog * dialog = new KDialog();
    dialog->setCaption(m_todo->summary());
    dialog->setButtons(KDialog::Ok | KDialog::Cancel);

    dialog->setMainWidget(m_editor);

    connect(dialog, SIGNAL(okClicked()), SLOT(saveTask()));

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

    dialog->show();

}
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();
}
Exemple #4
0
void FindFilesDialog::slotFinished()
{
	KILE_DEBUG() << "\tgrep: slot finished";
	clearGrepJobs();
	finish();
	delayedDestruct();
}
Exemple #5
0
void FindFilesDialog::slotClose()
{
	KILE_DEBUG() << "\tgrep: slot close";
	clearGrepJobs();
	finish();
	delayedDestruct();
}
Exemple #6
0
void DccRecipientDialog::newNicknameSelectedQuit(QListBoxItem* item)
{
    newNicknameSelected(item);
    selectedNickname=nicknameInput->text();

    delayedDestruct();
}
ProfileDialog::ProfileDialog(QWidget *parent, const char *name, bool modal)
    : KDialogBase(parent, name, modal, i18n("Load Profile"), Ok | Cancel, Ok, true)
{
    // tmp. vars:
    QWidget *page = makeMainWidget();
    QVBoxLayout *vlay = new QVBoxLayout(page, 0, spacingHint());

    mListView = new KListView(page, "mListView");
    mListView->addColumn(i18n("Available Profiles"));
    mListView->addColumn(i18n("Description"));
    mListView->setFullWidth(true);
    mListView->setAllColumnsShowFocus(true);
    mListView->setSorting(-1);

    vlay->addWidget(new QLabel(mListView,
                               i18n("&Select a profile and click 'OK' to "
                                    "load its settings:"), page));
    vlay->addWidget(mListView, 1);

    setup();

    connect(mListView, SIGNAL(selectionChanged()),
            SLOT(slotSelectionChanged()));
    connect(mListView, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)),
            SLOT(slotOk()));

    connect(this, SIGNAL(finished()), SLOT(delayedDestruct()));

    enableButtonOK(false);
}
KOIncidenceEditor::KOIncidenceEditor(const QString &caption,
                                     Calendar *calendar, QWidget *parent)
    : KDialogBase(Tabbed, caption, Ok | Apply | Cancel | Default, Ok,
                  parent, 0, false, false),
      mAttendeeEditor(0), mIsCounter(false)
{
    // Set this to be the group leader for all subdialogs - this means
    // modal subdialogs will only affect this dialog, not the other windows
    setWFlags(getWFlags() | WGroupLeader);

    mCalendar = calendar;

    if(KOPrefs::instance()->mCompactDialogs)
    {
        showButton(Apply, false);
        showButton(Default, false);
    }
    else
    {
        setButtonText(Default, i18n("&Templates..."));
    }

    connect(this, SIGNAL(defaultClicked()), SLOT(slotManageTemplates()));
    connect(this, SIGNAL(finished()), SLOT(delayedDestruct()));
}
Exemple #9
0
void AddresseeEditorDialog::slotCancel()
{
  KDialogBase::slotCancel();

  // Destroy this dialog
  delayedDestruct();
}
Exemple #10
0
void Dialog::configureTree()
{
    kdDebug(700) << k_funcinfo << endl;
    ComponentsDialog *subdlg = new ComponentsDialog(d->dlg);
    subdlg->setPluginInfos(d->plugininfomap);
    subdlg->show();
    connect(subdlg, SIGNAL(okClicked()), this, SLOT(updateTreeList()));
    connect(subdlg, SIGNAL(applyClicked()), this, SLOT(updateTreeList()));
    connect(subdlg, SIGNAL(okClicked()), this, SIGNAL(pluginSelectionChanged()));
    connect(subdlg, SIGNAL(applyClicked()), this, SIGNAL(pluginSelectionChanged()));
    connect(subdlg, SIGNAL(finished()), subdlg, SLOT(delayedDestruct()));
}
Exemple #11
0
void AddresseeEditorDialog::slotOk()
{
  if ( !mEditorWidget->readyToClose() )
    return;

  slotApply();

  KDialogBase::slotOk();

  // Destroy this dialog
  delayedDestruct();
}
Exemple #12
0
void EditNotifyDialog::slotOk()
{
    int id = m_networkNameCombo->itemData(m_networkNameCombo->currentIndex()).toInt();
    if (id == -1)
    {
      // add nickname to every server
      for (int i = 1; i < m_networkNameCombo->count(); ++i)
        emit notifyChanged(m_networkNameCombo->itemData(i).toInt(), m_nicknameInput->text());
    }
    else
      emit notifyChanged(id, m_nicknameInput->text());
    delayedDestruct();
}
void KOEditorAttachments::slotEdit()
{
  for ( Q3IconViewItem *item = mAttachments->firstItem(); item; item = item->nextItem() ) {
    if ( item->isSelected() ) {
      AttachmentIconItem *attitem = static_cast<AttachmentIconItem*>( item );
      if ( !attitem || !attitem->attachment() ) {
        return;
      }

      AttachmentEditDialog *dialog = new AttachmentEditDialog( attitem, mAttachments, false );
      dialog->setModal( false );
      connect( dialog, SIGNAL(hidden()), dialog, SLOT(delayedDestruct()) );
      dialog->show();
    }
  }
}
NotificationDialog::NotificationDialog( KFileItem medium, NotifierSettings *settings,
                                        TQWidget* parent, const char* name )
	: KDialogBase( parent, name, false, i18n( "Medium Detected" ), Ok|Cancel|User1, Ok, true),
	  m_medium(medium), m_settings( settings )
{
	setCaption( TDEIO::decodeFileName(m_medium.name()) );
	clearWState( WState_Polished );

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

	m_view = new NotificationDialogView( page );

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

	updateActionsListBox();

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


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

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

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

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

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

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

  connect( this, SIGNAL(finished()), this, SLOT(delayedDestruct()) );
  connect( this, SIGNAL(user1Clicked()), this, SLOT(editIncidence()) );
  connect( this, SIGNAL(user2Clicked()), this, SLOT(showIncidenceContext()) );
}
DeviceActionsDialog::DeviceActionsDialog(QWidget *parent)
    : KDialog(parent)
{
    setModal(false);
    setButtons(Ok|Cancel);
    setDefaultButton(Ok);

    QWidget *page = new QWidget(this);
    m_view.setupUi(page);
    setMainWidget(page);
    updateActionsListBox();

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

    connect(this, SIGNAL(okClicked()),
            this, SLOT(slotOk()));
    connect(m_view.actionsList, SIGNAL(doubleClicked(QListWidgetItem *, const QPoint &)),
            this, SLOT(slotOk()));

    connect(this, SIGNAL(finished()),
            this, SLOT(delayedDestruct()));
}