Esempio n. 1
0
void TIconView::setCategory( const QString& path )
{
    this->clear();

    QPixmap _icon = DesktopIcon(  "go",  KIcon::SizeMedium ); // defaultIcon

    KServiceGroup::Ptr category = KServiceGroup::group( path );
    if ( !category || !category->isValid() )
        return;

    KServiceGroup::List list = category->entries(  true,  true );
    KServiceGroup::List::ConstIterator it = list.begin();
    for (  ; it != list.end(); ++it )
    {
        KSycocaEntry *p = (  *it );
        if (  p->isType(  KST_KService ) )
        {
            // KCModuleInfo(KService*)
            KCModuleInfo *minfo = new KCModuleInfo(
                static_cast<KService*>(  p ) );

            if (  minfo->icon() )
                _icon = DesktopIcon(  minfo->icon(),  KIcon::SizeLarge );
            TIconViewItem* _item = new TIconViewItem( this,
                                                   minfo->moduleName(),
                                                   _icon, minfo );

            connect( this, SIGNAL( executed( QIconViewItem* ) ),
                     this, SLOT( slotItemSelected( QIconViewItem* ) ) );
        } // ignore second level subGroups!
    }
Esempio n. 2
0
// Adjust the visible icon.
void ThemeStandard::slotSetPixmap( const QString& pxn )
{
    QPixmap px = DesktopIcon( pxn );

    if ( px.isNull() )
        px = DesktopIcon( "go" );

    if ( !mIconsVisible )
        return;

    /* (We only use prev_i if jumping is enabled...) */
    if ( mIconsJumping && mPrevIcon )
        emit mPrevIcon->slotStopJumping();

    if ( mStdIconWidth < 0 )
        mStdIconWidth = DesktopIcon( "go" ).width();

    mIcon = new WndIcon( ++mIconCount, mStdIconWidth, mStatusBarHeight, mTheme->xineramaScreen(),
                         px, QString::null, mIconPos, mSbAtTop, mIconsJumping );
    mIcon->show();

    if( mIconsJumping )
    {
        emit mIcon->slotJump();
        mPrevIcon = mIcon;
    }
}
Esempio n. 3
0
void KWalletItem::setOpen(bool state) {
	if (_open != state) {
		_open = state;
		if (_open) {
			setIcon( DesktopIcon(QLatin1String( "wallet-open" )) );
		} else {
			setIcon( DesktopIcon(QLatin1String( "wallet-closed" )) );
		}
	}
}
Esempio n. 4
0
IconThemesConfig::IconThemesConfig(QWidget *parent, const char *name)
  : KCModule(parent, name)
{
  QVBoxLayout *topLayout = new QVBoxLayout(this, KDialog::marginHint(),
                                           KDialog::spacingHint());

  QFrame *m_preview=new QFrame(this);
  m_preview->setMinimumHeight(50);

  QHBoxLayout *lh2=new QHBoxLayout( m_preview );
  m_previewExec=new QLabel(m_preview);
  m_previewExec->setPixmap(DesktopIcon("exec"));
  m_previewFolder=new QLabel(m_preview);
  m_previewFolder->setPixmap(DesktopIcon("folder"));
  m_previewDocument=new QLabel(m_preview);
  m_previewDocument->setPixmap(DesktopIcon("document"));

  lh2->addStretch(10);
  lh2->addWidget(m_previewExec);
  lh2->addStretch(1);
  lh2->addWidget(m_previewFolder);
  lh2->addStretch(1);
  lh2->addWidget(m_previewDocument);
  lh2->addStretch(10);


  m_iconThemes=new KListView(this,"IconThemeList");
  m_iconThemes->addColumn(i18n("Name"));
  m_iconThemes->addColumn(i18n("Description"));
  m_iconThemes->setAllColumnsShowFocus( true );
  m_iconThemes->setFullWidth(true);
  connect(m_iconThemes,SIGNAL(selectionChanged(QListViewItem *)),
		SLOT(themeSelected(QListViewItem *)));

  QPushButton *installButton=new QPushButton( i18n("Install New Theme..."),
	this, "InstallNewTheme");
  connect(installButton,SIGNAL(clicked()),SLOT(installNewTheme()));
  m_removeButton=new QPushButton( i18n("Remove Theme"),
	this, "RemoveTheme");
  connect(m_removeButton,SIGNAL(clicked()),SLOT(removeSelectedTheme()));

  topLayout->addWidget(
	new QLabel(i18n("Select the icon theme you want to use:"), this));
  topLayout->addWidget(m_preview);
  topLayout->addWidget(m_iconThemes);
  QHBoxLayout *lg = new QHBoxLayout(topLayout, KDialog::spacingHint());
  lg->addWidget(installButton);
  lg->addWidget(m_removeButton);

  loadThemes();

  load();

  m_iconThemes->setFocus();
}
Esempio n. 5
0
/**
 * Return the icon corresponding to the given Diagram_Type.
 * @param dt   the diagram type
 * @return     the wanted icon
 */
QPixmap iconSet(Uml::DiagramType::Enum dt)
{
    switch (dt) {
        case Uml::DiagramType::UseCase:
            return DesktopIcon(it_Diagram_Usecase);
        case Uml::DiagramType::Collaboration:
            return DesktopIcon(it_Diagram_Collaboration);
        case Uml::DiagramType::Class:
            return DesktopIcon(it_Diagram_Class);
        case Uml::DiagramType::Sequence:
            return DesktopIcon(it_Diagram_Sequence);
        case Uml::DiagramType::State:
            return DesktopIcon(it_Diagram_State);
        case Uml::DiagramType::Activity:
            return DesktopIcon(it_Diagram_Activity);
        case Uml::DiagramType::Component:
            return DesktopIcon(it_Diagram_Component);
        case Uml::DiagramType::Deployment:
            return DesktopIcon(it_Diagram_Deployment);
        case Uml::DiagramType::EntityRelationship:
            return DesktopIcon(it_Diagram_EntityRelationship);
        default:
            uDebug() << "Widget_Utils::iconSet: unknown diagram type "
                     << Uml::DiagramType::toString(dt);
            return QPixmap();
    }
}
Esempio n. 6
0
SystemTray::SystemTray(QWidget *parent)
    : QObject(parent),
    _mode(Invalid),
    _state(Passive),
    _shouldBeVisible(true),
    _passiveIcon(DesktopIcon("quassel-inactive")),
    _activeIcon(DesktopIcon("quassel")),
    _needsAttentionIcon(DesktopIcon("quassel-message")),
    _trayMenu(0),
    _associatedWidget(parent)
{
    Q_ASSERT(parent);
}
Esempio n. 7
0
// ## where is this used?
QPixmap KFileItem::pixmap( int _size, int _state ) const
{
    const QString iconName = d->m_entry.stringValue( KIO::UDSEntry::UDS_ICON_NAME );
    if ( !iconName.isEmpty() )
        return DesktopIcon(iconName, _size, _state);

    if (!d->m_pMimeType) {
        // No mimetype determined yet, go for a fast default icon
        if (S_ISDIR(d->m_fileMode)) {
            static const QString * defaultFolderIcon = 0;
            if ( !defaultFolderIcon ) {
                const KMimeType::Ptr mimeType = KMimeType::mimeType( "inode/directory" );
                if ( mimeType )
                    defaultFolderIcon = &KGlobal::staticQString( mimeType->iconName() );
               else
                    kWarning(7000) << "No mimetype for inode/directory could be found. Check your installation.";
            }
            if ( defaultFolderIcon )
                return DesktopIcon( *defaultFolderIcon, _size, _state );

        }
        return DesktopIcon( "unknown", _size, _state );
    }

    KMimeType::Ptr mime;
    // Use guessed mimetype if the main one hasn't been determined for sure
    if ( !d->m_bMimeTypeKnown && !d->m_guessedMimeType.isEmpty() )
        mime = KMimeType::mimeType( d->m_guessedMimeType );
    else
        mime = d->m_pMimeType;

    // Support for gzipped files: extract mimetype of contained file
    // See also the relevant code in overlays, which adds the zip overlay.
    if ( mime->name() == "application/x-gzip" && d->m_url.fileName().endsWith( QLatin1String( ".gz" ) ) )
    {
        KUrl sf;
        sf.setPath( d->m_url.path().left( d->m_url.path().length() - 3 ) );
        //kDebug() << "subFileName=" << subFileName;
        mime = KMimeType::findByUrl( sf, 0, d->m_bIsLocalUrl );
    }

    bool isLocalUrl;
    KUrl url = mostLocalUrl(isLocalUrl);

    QPixmap p = KIconLoader::global()->loadMimeTypeIcon( mime->iconName( url ), KIconLoader::Desktop, _size, _state );
    //kDebug() << "finding pixmap for " << url.url() << " : " << mime->name();
    if (p.isNull())
        kWarning() << "Pixmap not found for mimetype " << d->m_pMimeType->name();

    return p;
}
Esempio n. 8
0
void MainWin::updateIcon() {
#ifdef Q_WS_MAC
  const int size = 128;
#else
  const int size = 48;
#endif

  QPixmap icon;
  if(Client::isConnected())
    icon = DesktopIcon("quassel", size);
  else
    icon = DesktopIcon("quassel_inactive", size);
  setWindowIcon(icon);
  qApp->setWindowIcon(icon);
}
Esempio n. 9
0
KexiPrjTypeSelector::KexiPrjTypeSelector(QWidget* parent)
        : QWidget(parent)
{
    setupUi(this);
    setObjectName("KexiPrjTypeSelector");
    QString none;
    icon_file->setPixmap(DesktopIcon(KexiDB::defaultFileBasedDriverIcon(), 48));
    icon_file->setFixedSize(icon_file->pixmap()->size() / 2);
    icon_server->setPixmap(DesktopIcon(KEXI_ICON_DATABASE_SERVER, 48));
    icon_server->setFixedSize(icon_server->pixmap()->size() / 2);

    connect(buttonGroup, SIGNAL(clicked(int)),
            this, SLOT(slotSelectionChanged(int)));

    slotSelectionChanged(1);
}
PreferencesAppearanceConfigPage::PreferencesAppearanceConfigPage( Knipptasch::Preferences *pref, ConfigWidget *parent )
    : AbstractConfigPage( tr( "Appearance" ), DesktopIcon( "preferences-desktop-theme" ), parent ),
      ui( new Ui::PreferencesAppearanceConfigPage ),
      m_preferences( pref )
{
    ui->setupUi( this );

    connect( ui->positiveAmountForegroundEnabled, SIGNAL( toggled( bool ) ),
             ui->fgPositiveAmountWidget, SLOT( setEditable( bool ) ) );
    connect( ui->negativeAmountForegroundEnabled, SIGNAL( toggled( bool ) ),
             ui->fgNegativeAmountWidget, SLOT( setEditable( bool ) ) );
    connect( ui->availableWarrantyForegroundEnabled, SIGNAL( toggled( bool ) ),
             ui->fgAvailableWarrantyWidget, SLOT( setEditable( bool ) ) );
    connect( ui->expiredWarrantyForegroundEnabled, SIGNAL( toggled( bool ) ),
             ui->fgExpiredWarrantyWidget, SLOT( setEditable( bool ) ) );
    connect( ui->currentPostingBackgroundEnabled, SIGNAL( toggled( bool ) ),
             ui->bgCurrentPostingWidget, SLOT( setEditable( bool ) ) );
    connect( ui->futurePostingBackgroundEnabled, SIGNAL( toggled( bool ) ),
             ui->bgFuturePostingWidget, SLOT( setEditable( bool ) ) );
    connect( ui->defaultPostingBackgroundEnabled, SIGNAL( toggled( bool ) ),
             ui->bgNormalPostingWidget, SLOT( setEditable( bool ) ) );
    connect( ui->incompletePostingBackgroundEnabled, SIGNAL( toggled( bool ) ),
             ui->bgIncompletePostingWidget, SLOT( setEditable( bool ) ) );

    connect( ui->positiveAmountForegroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->negativeAmountForegroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->availableWarrantyForegroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->expiredWarrantyForegroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->currentPostingBackgroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->futurePostingBackgroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->defaultPostingBackgroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->incompletePostingBackgroundEnabled, SIGNAL( stateChanged( int ) ),
             this, SIGNAL( pageModified() ) );

    connect( ui->fgPositiveAmountWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->fgNegativeAmountWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->fgAvailableWarrantyWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->fgExpiredWarrantyWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->bgCurrentPostingWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->bgFuturePostingWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->bgNormalPostingWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );
    connect( ui->bgIncompletePostingWidget, SIGNAL( colorChanged( QColor ) ),
             this, SIGNAL( pageModified() ) );

    revert();
}
Esempio n. 11
0
PurchaseEditor::PurchaseEditor( QWidget *parent)
: KDialog( parent )
{
    ui = new PurchaseEditorUI( this );
    setMainWidget( ui );
    setCaption( i18n("Purchase") );
    setButtons( KDialog::Ok|KDialog::Cancel );
    setDefaultButton(KDialog::None);

    ui->editDonor->setCustomLayout(1);

    ui->btnAddItem->setDefault(true);

    connect( ui->btnAddItem, SIGNAL( clicked() ), this, SLOT( addItemToList() ) );

    connect(ui->btnRemoveItem, SIGNAL( clicked() ), SLOT( deleteSelectedItem() ) );

    ui->chIsAGroup->setDisabled(true);

    
    QString path = KStandardDirs::locate("appdata", "styles/");
    path = path+"tip.svg";
    errorPanel = new MibitTip(this, ui->widgetPurchase, path, DesktopIcon("dialog-warning",32) );
    

    lastCode = "";
    status = estatusNormal;
    productExists = false;
    productsHash.clear();
    resetEdits();
    totalBuy = 0.0;
    itemCount = 0.0;
    ui->editDateTime->setDateTime(QDateTime::currentDateTime());
    QTimer::singleShot(500, this, SLOT(setupTable()));
}
Esempio n. 12
0
KTimerDialog::KTimerDialog(int msec, TimerStyle style, QWidget *parent, const char *name, bool modal, const QString &caption, int buttonMask,
                           ButtonCode defaultButton, bool separator, const KGuiItem &user1, const KGuiItem &user2, const KGuiItem &user3)
    : KDialogBase(parent, name, modal, caption, buttonMask, defaultButton, separator, user1, user2, user3)
{
    totalTimer = new QTimer(this);
    updateTimer = new QTimer(this);
    msecTotal = msecRemaining = msec;
    updateInterval = 1000;
    tStyle = style;
    KWin::setIcons(winId(), DesktopIcon("randr"), SmallIcon("randr"));
    // default to cancelling the dialog on timeout
    if(buttonMask & Cancel)
        buttonOnTimeout = Cancel;

    connect(totalTimer, SIGNAL(timeout()), SLOT(slotInternalTimeout()));
    connect(updateTimer, SIGNAL(timeout()), SLOT(slotUpdateTime()));

    // create the widgets
    mainWidget = new QVBox(this, "mainWidget");
    timerWidget = new QHBox(mainWidget, "timerWidget");
    timerLabel = new QLabel(timerWidget);
    timerProgress = new QProgressBar(timerWidget);
    timerProgress->setTotalSteps(msecTotal);
    timerProgress->setPercentageVisible(false);

    KDialogBase::setMainWidget(mainWidget);

    slotUpdateTime(false);
}
Esempio n. 13
0
ConfigDlg::ConfigDlg(QWidget *parent, const char *name)
: KDialogBase(IconList, i18n("Configuration"), Ok|Cancel, Ok, parent, name, true)
{
	QVBox	*page1 = addVBoxPage(i18n("Personal"), i18n("Personal Settings"), DesktopIcon("kdmconfig"));
	m_general = new ConfGeneral(page1, "Personal");

	QVBox	*page2 = addVBoxPage(i18n("Page setup"), i18n("Page Setup"), DesktopIcon("editcopy"));
	m_fax = new ConfFax(page2, "Fax");

	QVBox	*page3 = addVBoxPage(i18n("System"), i18n("Fax System Selection"), DesktopIcon("kdeprintfax"));
	m_system = new ConfSystem(page3, "System");

	QVBox	*page4 = addVBoxPage(i18n("Filters"), i18n("Filters Configuration"), DesktopIcon("filter"));
	m_filters = new ConfFilters(page4, "Filters");

	resize(450, 300);
}
Esempio n. 14
0
QPixmap KFileItem::pixmap( int _size, int _state ) const
{
  if (d && (!d->iconName.isEmpty()))
     return DesktopIcon(d->iconName,_size,_state);

  if ( !m_pMimeType )
  {
    static const QString & defaultFolderIcon =
       KGlobal::staticQString(KMimeType::mimeType( "inode/directory" )->KServiceType::icon());

    if ( S_ISDIR( m_fileMode ) )
     return DesktopIcon( defaultFolderIcon, _size, _state );

    return DesktopIcon( "unknown", _size, _state );
  }

  _state |= overlays();

  KMimeType::Ptr mime;
  // Use guessed mimetype if the main one hasn't been determined for sure
  if ( !m_bMimeTypeKnown && !m_guessedMimeType.isEmpty() )
      mime = KMimeType::mimeType( m_guessedMimeType );
  else
      mime = m_pMimeType;

  // Support for gzipped files: extract mimetype of contained file
  // See also the relevant code in overlays, which adds the zip overlay.
  if ( mime->name() == "application/x-gzip" && m_url.fileName().right(3) == ".gz" )
  {
      KURL sf;
      sf.setPath( m_url.path().left( m_url.path().length() - 3 ) );
      //kdDebug() << "KFileItem::pixmap subFileName=" << subFileName << endl;
      mime = KMimeType::findByURL( sf, 0, m_bIsLocalURL );
  }

  bool isLocalURL;
  KURL url = mostLocalURL(isLocalURL);

  QPixmap p = mime->pixmap( url, KIcon::Desktop, _size, _state );
  //kdDebug() << "finding pixmap for " << url.url() << " : " << mime->name() << endl;
  if (p.isNull())
      kdWarning() << "Pixmap not found for mimetype " << m_pMimeType->name() << endl;

  return p;
}
KexiDBConnectionWidget::KexiDBConnectionWidget(QWidget* parent)
        : QWidget(parent)
        , d(new Private())
{
    setupUi(this);
    setObjectName("KexiConnSelectorWidget");
    iconLabel->setPixmap(DesktopIcon(KEXI_ICON_DATABASE_SERVER));

    QVBoxLayout *driversComboLyr = new QVBoxLayout(frmEngine);
    m_driversCombo = new KexiDBDriverComboBox(frmEngine, Kexi::driverManager().driversInfo(),
            KexiDBDriverComboBox::ShowServerDrivers);
    //lblEngine->setFocusProxy( m_driversCombo );
    driversComboLyr->addWidget(m_driversCombo);
    frmEngine->setFocusProxy(m_driversCombo);
    lblEngine->setBuddy(m_driversCombo);
    QWidget::setTabOrder(lblEngine, m_driversCombo);

#ifdef NO_LOAD_DB_LIST
    btnLoadDBList->hide();
#endif
    btnLoadDBList->setIcon(KIcon("view-refresh"));
    btnLoadDBList->setToolTip(i18n("Load database list from the server"));
    btnLoadDBList->setWhatsThis(
        i18n("Loads database list from the server, so you can select one using the \"Name\" combo box."));

    QHBoxLayout *hbox = new QHBoxLayout(frmBottom);
    hbox->addStretch(2);
    d->btnSaveChanges = new KPushButton(
        KGuiItem(
            i18n("Save Changes"), "document-save",
            i18n("Save all changes made to this connection information"),
            i18n("Save all changes made to this connection information. "
                 "You can later reuse this information.")),
        frmBottom);
    d->btnSaveChanges->setObjectName("savechanges");
    hbox->addWidget(d->btnSaveChanges);
    hbox->addSpacing(KDialog::spacingHint());
    QWidget::setTabOrder(titleEdit, d->btnSaveChanges);
    d->btnSaveChanges->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    d->btnTestConnection = new KPushButton(
// @todo add Test Connection icon
        KGuiItem(i18n("&Test Connection"), QString(),
                 i18n("Test database connection"),
                 i18n("Tests database connection. "
                      "You can ensure that valid connection information is provided.")),
        frmBottom);
    d->btnTestConnection->setObjectName("testConnection");
    hbox->addWidget(d->btnTestConnection);
    setTabOrder(d->btnSaveChanges, d->btnTestConnection);
    d->btnTestConnection->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    connect(locationBGrp, SIGNAL(clicked(int)), this, SLOT(slotLocationBGrpClicked(int)));
    connect(chkPortDefault, SIGNAL(toggled(bool)), this , SLOT(slotCBToggled(bool)));
    connect(btnLoadDBList, SIGNAL(clicked()), this, SIGNAL(loadDBList()));
    connect(d->btnSaveChanges, SIGNAL(clicked()), this, SIGNAL(saveChanges()));
}
Esempio n. 16
0
QPixmap MyMoneyInstitution::pixmap() const
{
  QPixmap institution;
  if (!QPixmapCache::find("view-bank", institution)) {
    institution = DesktopIcon("view-bank");
    QPixmapCache::insert("view-bank", institution);
  }
  return institution;
}
Esempio n. 17
0
KexiStartupDialog::KexiStartupDialog(
    int dialogType, int dialogOptions,
    KexiDBConnectionSet& connSet, KexiProjectSet& recentProjects,
    QWidget *parent)
        : KPageDialog(parent)
        , d(new Private())
{
    d->singlePage = dialogType == KexiStartupDialog::Templates
                    || dialogType == KexiStartupDialog::OpenExisting || dialogType == KexiStartupDialog::OpenRecent;
    setFaceType(d->singlePage ? Plain : Tabbed);
    setCaption(captionForDialogType(dialogType));
    setButtons(Help | Ok | Cancel);
    d->recentProjects = &recentProjects;
    d->connSet = &connSet;
    d->dialogType = dialogType;
    d->dialogOptions = dialogOptions;

    if (dialogType == OpenExisting) {//this dialog has "open" tab only!
        setWindowIcon(DesktopIcon("document-open"));
    } else {
        setWindowIcon(d->kexi_sqlite_icon);
    }

    setSizeGripEnabled(true);
// int id=0;
    KPageWidgetItem *firstPage = 0;
    if (d->dialogType & Templates) {
        setupPageTemplates();
        //d->pageTemplatesID = id++;
        d->templatesWidget->setFocus();
        if (!firstPage)
            firstPage = d->pageTemplates;
    }
    if (d->dialogType & OpenExisting) {
        setupPageOpenExisting();
//  d->pageOpenExistingID = id++;
        if (d->singlePage)
            d->openExistingConnWidget->setFocus();
        if (!firstPage)
            firstPage = d->pageOpenExisting;
    }
#ifdef KEXI_STARTUP_SHOW_RECENT
    if (d->dialogType & OpenRecent) {
        setupPageOpenRecent();
//  d->pageOpenRecentID = id++;
        if (d->singlePage)
            d->prj_selector->setFocus();
        if (!firstPage)
            firstPage = d->pageOpenRecent;
    }
#endif

    if (!d->singlePage) {
        connect(this, SIGNAL(currentPageChanged(KPageWidgetItem*, KPageWidgetItem*)),
                this, SLOT(slotCurrentPageChanged(KPageWidgetItem*, KPageWidgetItem*)));
        d->templatesWidget->setFocus();
    }
Esempio n. 18
0
void TCategoryView::setCategory( const QString& path, const QString& icon, const QString& title )
{
  QPixmap _icon = DesktopIcon( icon, KIcon::SizeLarge );
  _title->setPixmap( _icon );

  _title->setText( title );

  _iconview->setCategory( path );

   this->path=path;
}
Esempio n. 19
0
void KKameraConfig::populateDeviceListView(void)
{
	m_deviceSel->clear();
	CameraDevicesMap::Iterator it;
	for (it = m_devices.begin(); it != m_devices.end(); it++) {
		if (it.data()) {
			new QIconViewItem(m_deviceSel, it.key(), DesktopIcon("camera"));
		}
	}
	slot_deviceSelected(m_deviceSel->currentItem());
}
Esempio n. 20
0
void TIconView::setCategory( const QString& path )
{
    clear();

    QPixmap _icon = DesktopIcon( "go", KIcon::SizeMedium ); // defaultIcon

    KServiceGroup::Ptr category = KServiceGroup::group( path );
    if ( !category || !category->isValid() )
        return;

    TIconViewItem *_item;
    KServiceGroup::List list = category->entries(  true,  true );
    KServiceGroup::List::ConstIterator it = list.begin();
    KServiceGroup::List::ConstIterator end = list.end();
    for (  ; it != end; ++it )
    {
        KSycocaEntry *p = (  *it );
        if (  p->isType(  KST_KService ) )
        {
            // KCModuleInfo(KService*)
            KCModuleInfo *minfo = new KCModuleInfo(
                static_cast<KService*>(  p ) );

            if (showExtras == false)
            {
                KSimpleConfig cfg(minfo->fileName());

                cfg.setDesktopGroup();
                if ( cfg.readEntry("Categories").contains("X-KDE-tasma-extra") )
                    continue;
            }

            if (  minfo->icon() )
                _icon = DesktopIcon(  minfo->icon(),  KIcon::SizeLarge );
            _item = new TIconViewItem( this,
                                       minfo->moduleName(),
                                       _icon, minfo , minfo->comment());
        } // ignore second level subGroups!
    }
    list.clear();
}
void KMoneyThingMainWidget::setupPages()
{
  QVBoxLayout *layout;

  homeFrame = addPage(i18n("Home"), i18n("Home"), DesktopIcon("folder_home"));
  layout = new QVBoxLayout(homeFrame);
  homeView = new KMoneyThingHomeView(homeFrame, 0, mCurrentFile);
  layout->addWidget(homeView);
  connect(this, SIGNAL(signalRefresh()), homeView, SLOT(slotRefresh()));
  connect(homeView, SIGNAL(undoOrSave(KMoneyThingView* )), this, SLOT(slotUndoOrSave(KMoneyThingView* )));
  
  accountsFrame = addPage(i18n("Accounts"), i18n("Accounts"), DesktopIcon("identity"));
  layout = new QVBoxLayout(accountsFrame);
  accountsView = new KMoneyThingAccountsView(accountsFrame, 0, mCurrentFile);
  layout->addWidget(accountsView);
  connect(this, SIGNAL(signalRefresh()), accountsView, SLOT(slotRefresh()));
  connect(accountsView, SIGNAL(undoOrSave(KMoneyThingView* )), this, SLOT(slotUndoOrSave(KMoneyThingView* )));
  
  calendarFrame = addPage(i18n("Schedule"), i18n("Schedule"), DesktopIcon("today"));
  
  categoriesFrame = addPage(i18n("Categories"), i18n("Categories"), DesktopIcon("folder"));
  layout = new QVBoxLayout(categoriesFrame);
  categoriesView = new KMoneyThingCategoriesView(categoriesFrame, 0, mCurrentFile);
  layout->addWidget(categoriesView);
  connect(this, SIGNAL(signalRefresh()), categoriesView, SLOT(slotRefresh()));
  connect(categoriesView, SIGNAL(undoOrSave(KMoneyThingView* )), this, SLOT(slotUndoOrSave(KMoneyThingView* )));
  
  findFrame = addPage(i18n("Find"), i18n("Find"), DesktopIcon("find"));
  transactionsFrame = addPage(i18n("Transactions"), i18n("Transactions"), DesktopIcon("view_text"));
}
Esempio n. 22
0
/** Save an icon to a folder.
  * If an icon with the same name already exist in the destination,
  * it is assumed the icon is already copied, so no action is took.
  * It is optimized so that you can have an empty folder receiving the icons
  * and call copyIcon() each time you encounter one during export process.
  */
QString HTMLExporter::copyIcon(const QString &iconName, int size)
{
    if (iconName.isEmpty())
        return "";

    // Sometimes icon can be "favicons/www.kde.org", we replace the '/' with a '_'
    QString fileName = iconName; // QString::replace() isn't const, so I must copy the string before
    fileName = "ico" + QString::number(size) + "_" + fileName.replace("/", "_") + ".png";
    QString fullPath = iconsFolderPath + fileName;
    if (!QFile::exists(fullPath))
        DesktopIcon(iconName, size).save(fullPath, "PNG");
    return fileName;
}
Esempio n. 23
0
void ThumbnailList::slotDelayTimeout()
{
    // resize the bookmark overlay
    delete m_bookmarkOverlay;
    int expectedWidth = contentsWidth() / 4;
    if ( expectedWidth > 10 )
        m_bookmarkOverlay = new QPixmap( DesktopIcon( "attach", expectedWidth ) );
    else
        m_bookmarkOverlay = 0;

    // request pixmaps
    slotRequestVisiblePixmaps();
}
Esempio n. 24
0
AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent) {
  ui.setupUi(this);
  ui.quasselLogo->setPixmap(DesktopIcon("quassel", IconLoader::SizeHuge));

  ui.versionLabel->setText(QString(tr("<b>Version:</b> %1<br><b>Protocol version:</b> %2<br><b>Built:</b> %3"))
                           .arg(Quassel::buildInfo().fancyVersionString)
			   .arg(Quassel::buildInfo().protocolVersion)
			   .arg(Quassel::buildInfo().buildDate));
  ui.aboutTextBrowser->setHtml(about());
  ui.authorTextBrowser->setHtml(authors());
  ui.contributorTextBrowser->setHtml(contributors());
  ui.thanksToTextBrowser->setHtml(thanksTo());

  setWindowIcon(Icon("quassel"));
}
Esempio n. 25
0
k2send::k2send()
    : KMainWindow( 0, "k2send" ),
      m_printer(0)
{
    m_config = new KConfig("k2send");
    m_view = new k2sendWidget(this,"k2sendwidget",0,m_config);

    setAcceptDrops(FALSE);

    setCentralWidget(m_view);
    setupActions();
    statusBar()->show();
    setAutoSaveSettings();
    statusBar()->insertFixedItem("9999 Files", 0, true);
    statusBar()->insertFixedItem("00:00:00", 1, true);
    statusBar()->insertFixedItem("000 kbit/s", 2, true);
    statusBar()->insertFixedItem("Loud: 0", 3, true);
    statusBar()->insertFixedItem("00:00:00:00:00:00 ", 4, true);
    statusBar()->changeItem ("0 Files", 0);
    statusBar()->changeItem ("0 kbit/s", 2);

    trayicon = new KSystemTray(this, "k2sendtray");
    trayicon->show();
    trayicon->setPixmap (DesktopIcon( "k2send", 24));
    KPopupMenu * pop = trayicon->contextMenu() ;
    pop->insertItem(DesktopIcon( "player_play", 16 ), "Play",  m_view, SLOT(slotPlay()), CTRL+Key_P ,1,1);
    pop->insertItem(DesktopIcon( "player_stop", 16 ), "Stop",  m_view, SLOT(slotStop()), CTRL+Key_S ,2,2);
    pop->insertItem(DesktopIcon( "player_fwd", 16 ), "Next",  m_view, SLOT(slotSkip()), CTRL+Key_N ,3,3);
    pop->insertItem( "Loundess",  m_view, SLOT(slotLoudness()), CTRL+Key_L ,4,4);

    connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)),
            this,   SLOT(changeStatusbar(const QString&)));
    connect(m_view, SIGNAL(signalChangeCaption(const QString&)),
            this,   SLOT(changeCaption(const QString&)));

}
Esempio n. 26
0
IconSizeDialog::IconSizeDialog(const QString &caption, const QString &message, const QString &icon, int iconSize, QWidget *parent)
        : QDialog(parent)
{
    // QDialog options
    setWindowTitle(caption);

    QWidget *mainWidget = new QWidget(this);
    QVBoxLayout *mainLayout = new QVBoxLayout;
    setLayout(mainLayout);
    mainLayout->addWidget(mainWidget);

    setModal(true);

    QWidget *page = new QWidget(this);
    QVBoxLayout *topLayout = new QVBoxLayout(page);

    QLabel *label = new QLabel(message, page);
    topLayout->addWidget(label);

    QListWidget *iconView = new UndraggableKIconView(page);

    m_size16  = new QListWidgetItem(DesktopIcon(icon, 16), i18n("16 by 16 pixels"), iconView);
    m_size22  = new QListWidgetItem(DesktopIcon(icon, 22), i18n("22 by 22 pixels"), iconView);
    m_size32  = new QListWidgetItem(DesktopIcon(icon, 32), i18n("32 by 32 pixels"), iconView);
    m_size48  = new QListWidgetItem(DesktopIcon(icon, 48), i18n("48 by 48 pixels"), iconView);
    m_size64  = new QListWidgetItem(DesktopIcon(icon, 64), i18n("64 by 64 pixels"), iconView);
    m_size128 = new QListWidgetItem(DesktopIcon(icon, 128), i18n("128 by 128 pixels"), iconView);
    iconView->setIconSize(QSize(128, 128));
    iconView->setMinimumSize(QSize(128*6 + (6 + 2) * iconView->spacing() + 20, m_size128->sizeHint().height() + 2 * iconView->spacing() + 20));
    topLayout->addWidget(iconView);
    switch (iconSize) {
    case 16:  m_size16->setSelected(true); m_iconSize = 16;  break;
    case 22:  m_size22->setSelected(true); m_iconSize = 22;  break;
    default:
    case 32:  m_size32->setSelected(true); m_iconSize = 32;  break;
    case 48:  m_size48->setSelected(true); m_iconSize = 48;  break;
    case 64:  m_size64->setSelected(true); m_iconSize = 64;  break;
    case 128: m_size128->setSelected(true); m_iconSize = 128; break;
    }

    connect(iconView, SIGNAL(executed(QListWidgetItem*)),      this, SLOT(choose(QListWidgetItem*)));
    connect(iconView, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(choose(QListWidgetItem*)));
    connect(iconView, SIGNAL(itemSelectionChanged()),          this, SLOT(slotSelectionChanged()));

    mainLayout->addWidget(page);

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel, this);
    okButton = buttonBox->button(QDialogButtonBox::Ok);
    okButton->setDefault(true);
    okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    mainLayout->addWidget(buttonBox);
    connect(buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), SLOT(slotCancel()));
}
void
K2sendPlayListItem::setPlaying (bool p)
{
    _playing = p;
    if (p) {
        setSelected (FALSE);
        setHeight (_double_height);
        setText (0, 0);
        setPixmap (0, DesktopIcon ("player_play", 16));
    }
    else {
        setHeight (_normal_height);
        setPixmap (0, 0);
        setText (0, str_id);
    }
}
 virtual QVariant data(const QModelIndex &index, int role) const
 {
     switch (role) {
         case KCategorizedSortFilterProxyModel::CategoryDisplayRole: {
                 return QString::number(index.row() / 10);
             }
         case KCategorizedSortFilterProxyModel::CategorySortRole: {
                 return index.row() / 10;
             }
         case Qt::DecorationRole:
             return DesktopIcon(icons[index.row() % 4], KIconLoader::Desktop);
         default:
             break;
     }
     return QStringListModel::data(index, role);
 }
Esempio n. 29
0
KTimerDialog::KTimerDialog( int msec, TimerStyle style, QWidget *parent,
                 const char *name, bool modal,
                 const QString &caption,
                 int buttonMask, ButtonCode defaultButton,
                 bool separator,
                 const KGuiItem &user1,
                 const KGuiItem &user2,
                 const KGuiItem &user3 )
    : KDialog( parent )
{
    setObjectName( name );
    setModal( modal );
    setCaption( caption );
    setButtons( (ButtonCodes)buttonMask );
    setDefaultButton( defaultButton );
    showButtonSeparator( separator );
    setButtonGuiItem( User1, user1 );
    setButtonGuiItem( User2, user2 );
    setButtonGuiItem( User3, user3 );

    totalTimer = new QTimer( this );
    totalTimer->setSingleShot( true );
    updateTimer = new QTimer( this );
    updateTimer->setSingleShot( false );
    msecTotal = msecRemaining = msec;
    updateInterval = 1000;
    tStyle = style;
	KWindowSystem::setIcons( winId(), DesktopIcon("randr"), SmallIcon("randr") );
    // default to canceling the dialog on timeout
    if ( buttonMask & Cancel )
        buttonOnTimeout = Cancel;

    connect( totalTimer, SIGNAL( timeout() ), SLOT( slotInternalTimeout() ) );
    connect( updateTimer, SIGNAL( timeout() ), SLOT( slotUpdateTime() ) );

    // create the widgets
    mainWidget = new KVBox( this );
    timerWidget = new KHBox( mainWidget );
    timerLabel = new QLabel( timerWidget );
    timerProgress = new QProgressBar( timerWidget );
    timerProgress->setRange( 0, msecTotal );
    timerProgress->setTextVisible( false );

    KDialog::setMainWidget( mainWidget );

    slotUpdateTime( false );
}
Esempio n. 30
0
void lemon::reactOnLogOn()
{
  if (m_view->canStartSelling())
    enableUi();
  else {
    disableUi();
    QString msg = i18n("Administrator or Supervisor needs to start operation before you can start selling...");
    //Show a dialog saying that operations need to be started by admin ???
    if (m_view->getLoggedUserRole() == roleBasic ) {
      KNotification *notify = new KNotification("information", this);
      notify->setText(msg);
      QPixmap pixmap = DesktopIcon("dialog-information",48);
      notify->setPixmap(pixmap);
      notify->sendEvent();
    }
  }
}