コード例 #1
0
ファイル: quicklauncher.cpp プロジェクト: Fat-Zer/tdebase
QuickLauncher::QuickLauncher(const TQString& configFile, Type type, int actions,
                             TQWidget *parent, const char *name) : 
    KPanelApplet(configFile, type, actions, parent, name)
{
    DCOPObject::setObjId("QuickLauncherApplet");
    DEBUGSTR << endl << endl << endl << "------------" << flush;
    DEBUGSTR << "QuickLauncher::QuickLauncher(" << configFile << ",...)" <<
                endl << flush;

    m_settings = new Prefs(sharedConfig());
    m_settings->readConfig();

    m_needsSave = false;
    m_needsRefresh = false;
    m_refreshEnabled = false;

    m_configDialog = 0;
    m_popup = 0;
    m_appletPopup = 0;
    m_removeAppsMenu = 0;

    m_dragAccepted = false;

    m_buttons = new ButtonGroup;
    m_manager = new FlowGridManager;
    m_newButtons = 0;
    m_oldButtons = 0;
    m_dragButtons = 0;

    m_configAction = new TDEAction(i18n("Configure Quicklauncher..."), "configure", TDEShortcut(),
        TQT_TQOBJECT(this), TQT_SLOT(slotConfigure()), TQT_TQOBJECT(this));

    m_saveTimer = new TQTimer(this, "m_saveTimer");
    connect(m_saveTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(saveConfig()));

    m_popularity = new PopularityStatistics();

    setBackgroundOrigin(AncestorOrigin);

    loadConfig();

    buildPopupMenu();
    m_minPanelDim = std::max(16, m_settings->iconDimChoices()[1]);
    refreshContents();
    setRefreshEnabled(true);

    setAcceptDrops(true);
    //TQToolTip::add(this, i18n("Drop applications here"));
    DEBUGSTR << "    QuickLauncher::QuickLauncher(" << configFile << 
                ",...) END" << endl << flush;

    DCOPClient *dcopClient = TDEApplication::dcopClient();
    dcopClient->connectDCOPSignal(0, "appLauncher", 
        "serviceStartedByStorageId(TQString,TQString)",
        "QuickLauncherApplet",
        "serviceStartedByStorageId(TQString,TQString)",
        false);
    kdDebug() << "Quicklauncher registered DCOP signal" << endl;
}
コード例 #2
0
ファイル: evachatview.cpp プロジェクト: MagicGroup/eva
EvaChatView::EvaChatView( TQWidget * parent, const char * name )
    : TDEHTMLPart(parent, name), menu(NULL), d(0), buffer(""), m_isScrollAtBottom(true)
{
    //setOnlyLocalReferences(true);
    menu = new TDEPopupMenu(0, "popup");
    copyAction = KStdAction::copy( this, SLOT(copy()), actionCollection());
    copyAction->setText(i18n("&Copy Text"));
    copyAction->setShortcut( TDEShortcut("Ctrl+C"));

    setDNDEnabled(true);
    setAutoloadImages(true);
    view()->setHScrollBarMode(TQScrollView::AlwaysOff);

    //setStandardFont("Helvetica");
    //buffer += "<body style=\"font-size:9pt;font-family:Helvetica\">";

    TQObject::connect(view(), SIGNAL(finishedLayout()), SLOT(slotScrollToBottom()));
    TQObject::connect(this, SIGNAL(selectionChanged()), SLOT(slotSelectionChanged()));
    TQObject::connect(this, SIGNAL(popupMenu(const TQString &, const TQPoint &)),
                      SLOT(slotPopupMenu(const TQString &, const TQPoint &)));
    TQObject::connect(browserExtension(), SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)),
                      SLOT(slotLinkClicked( const KURL &, const KParts::URLArgs &)));
}
コード例 #3
0
ファイル: katefileselector.cpp プロジェクト: Fat-Zer/tdebase
KateFileSelector::KateFileSelector( KateMainWindow *mainWindow,
                                    KateViewManager *viewManager,
                                    TQWidget * parent, const char * name )
    : TQVBox (parent, name),
      mainwin(mainWindow),
      viewmanager(viewManager)
{
  mActionCollection = new TDEActionCollection( this );

  TQtMsgHandler oldHandler = tqInstallMsgHandler( silenceQToolBar );

  KateFileSelectorToolBarParent *tbp=new KateFileSelectorToolBarParent(this);
  toolbar = new KateFileSelectorToolBar(tbp);
  tbp->setToolBar(toolbar);
  toolbar->setMovingEnabled(false);
  toolbar->setFlat(true);
  tqInstallMsgHandler( oldHandler );

  cmbPath = new KURLComboBox( KURLComboBox::Directories, true, this, "path combo" );
  cmbPath->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ));
  KURLCompletion* cmpl = new KURLCompletion(KURLCompletion::DirCompletion);
  cmbPath->setCompletionObject( cmpl );
  cmbPath->setAutoDeleteCompletionObject( true );
  cmbPath->listBox()->installEventFilter( this );

  dir = new KDirOperator(KURL(), this, "operator");
  dir->setView(KFile::/* Simple */Detail);
  dir->view()->setSelectionMode(KFile::Extended);
  connect ( dir, TQT_SIGNAL( viewChanged(KFileView *) ),
                   this, TQT_SLOT( selectorViewChanged(KFileView *) ) );
  setStretchFactor(dir, 2);

  TDEActionCollection *coll = dir->actionCollection();
  // some shortcuts of diroperator that clashes with Kate
  coll->action( "delete" )->setShortcut( TDEShortcut( ALT + Key_Delete ) );
  coll->action( "reload" )->setShortcut( TDEShortcut( ALT + Key_F5 ) );
  coll->action( "back" )->setShortcut( TDEShortcut( ALT + SHIFT + Key_Left ) );
  coll->action( "forward" )->setShortcut( TDEShortcut( ALT + SHIFT + Key_Right ) );
  // some consistency - reset up for dir too
  coll->action( "up" )->setShortcut( TDEShortcut( ALT + SHIFT + Key_Up ) );
  coll->action( "home" )->setShortcut( TDEShortcut( CTRL + ALT + Key_Home ) );

  // bookmarks action!
  TDEActionMenu *acmBookmarks = new TDEActionMenu( i18n("Bookmarks"), "bookmark",
        mActionCollection, "bookmarks" );
  acmBookmarks->setDelayed( false );
  bookmarkHandler = new KBookmarkHandler( this, acmBookmarks->popupMenu() );
  TQHBox* filterBox = new TQHBox(this);

  btnFilter = new TQToolButton( filterBox );
  btnFilter->setIconSet( SmallIconSet("filter" ) );
  btnFilter->setToggleButton( true );
  filter = new KHistoryCombo( true, filterBox, "filter");
  filter->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ));
  filterBox->setStretchFactor(filter, 2);
  connect( btnFilter, TQT_SIGNAL( clicked() ), this, TQT_SLOT( btnFilterClick() ) );

  connect( filter, TQT_SIGNAL( activated(const TQString&) ),
                   TQT_SLOT( slotFilterChange(const TQString&) ) );
  connect( filter, TQT_SIGNAL( returnPressed(const TQString&) ),
           filter, TQT_SLOT( addToHistory(const TQString&) ) );

  // tdeaction for the dir sync method
  acSyncDir = new TDEAction( i18n("Current Document Folder"), "curfiledir", 0,
        TQT_TQOBJECT(this), TQT_SLOT( setActiveDocumentDir() ), mActionCollection, "sync_dir" );
  toolbar->setIconText( TDEToolBar::IconOnly );
  toolbar->setIconSize( 16 );
  toolbar->setEnableContextMenu( false );

  connect( cmbPath, TQT_SIGNAL( urlActivated( const KURL&  )),
             this,  TQT_SLOT( cmbPathActivated( const KURL& ) ));
  connect( cmbPath, TQT_SIGNAL( returnPressed( const TQString&  )),
             this,  TQT_SLOT( cmbPathReturnPressed( const TQString& ) ));
  connect(dir, TQT_SIGNAL(urlEntered(const KURL&)),
             this, TQT_SLOT(dirUrlEntered(const KURL&)) );

  connect(dir, TQT_SIGNAL(finishedLoading()),
             this, TQT_SLOT(dirFinishedLoading()) );

  // enable dir sync button if current doc has a valid URL
  connect ( viewmanager, TQT_SIGNAL( viewChanged() ),
              this, TQT_SLOT( kateViewChanged() ) );

  // Connect the bookmark handler
  connect( bookmarkHandler, TQT_SIGNAL( openURL( const TQString& )),
           this, TQT_SLOT( setDir( const TQString& ) ) );

  waitingUrl = TQString::null;

  // whatsthis help
  TQWhatsThis::add( cmbPath,
       i18n("<p>Here you can enter a path for a folder to display."
            "<p>To go to a folder previously entered, press the arrow on "
            "the right and choose one. <p>The entry has folder "
            "completion. Right-click to choose how completion should behave.") );
  TQWhatsThis::add( filter,
        i18n("<p>Here you can enter a name filter to limit which files are displayed."
             "<p>To clear the filter, toggle off the filter button to the left."
             "<p>To reapply the last filter used, toggle on the filter button." ) );
  TQWhatsThis::add( btnFilter,
        i18n("<p>This button clears the name filter when toggled off, or "
             "reapplies the last filter used when toggled on.") );

}
コード例 #4
0
ファイル: basictab.cpp プロジェクト: Fat-Zer/tdebase
void BasicTab::setEntryInfo(MenuEntryInfo *entryInfo)
{
    blockSignals(true);
    _menuFolderInfo = 0;
    _menuEntryInfo = entryInfo;
    
    if (!entryInfo)
    {
       _nameEdit->setText(TQString::null);
       _descriptionEdit->setText(TQString::null);
       _commentEdit->setText(TQString::null);
       _iconButton->setIcon(TQString::null);

       // key binding part
       _keyEdit->setShortcut( TDEShortcut(), false );
       _execEdit->lineEdit()->setText(TQString::null);
       _systrayCB->setChecked(false);

       _pathEdit->lineEdit()->setText(TQString::null);
       _termOptEdit->setText(TQString::null);
       _uidEdit->setText(TQString::null);

       _launchCB->setChecked(false);
       _terminalCB->setChecked(false);
       _uidCB->setChecked(false);
       enableWidgets(true, true);
       blockSignals(false);
       return;
    }

    KDesktopFile *df = entryInfo->desktopFile();

    _nameEdit->setText(df->readName());
    _descriptionEdit->setText(df->readGenericName());
    _descriptionEdit->setCursorPosition(0);
    _commentEdit->setText(df->readComment());
    _commentEdit->setCursorPosition(0);
    _iconButton->setIcon(df->readIcon());

    // key binding part
    if( KHotKeys::present())
    {
        _keyEdit->setShortcut( entryInfo->shortcut(), false );
    }

    TQString temp = df->readPathEntry("Exec");
    if (temp.left(12) == "ksystraycmd ")
    {
      _execEdit->lineEdit()->setText(temp.right(temp.length()-12));
      _systrayCB->setChecked(true);
    }
    else
    {
      _execEdit->lineEdit()->setText(temp);
      _systrayCB->setChecked(false);
    }

    _pathEdit->lineEdit()->setText(df->readPath());
    _termOptEdit->setText(df->readEntry("TerminalOptions"));
    if( df->hasKey( "X-TDE-Username" )) {
        _uidEdit->setText(df->readEntry("X-TDE-Username"));
    }
    else {
        _uidEdit->setText(df->readEntry("X-KDE-Username"));
    }

    if( df->hasKey( "StartupNotify" ))
        _launchCB->setChecked(df->readBoolEntry("StartupNotify", true));
    else // backwards comp.
        _launchCB->setChecked(df->readBoolEntry("X-TDE-StartupNotify", true));

    if(df->readNumEntry("Terminal", 0) == 1)
        _terminalCB->setChecked(true);
    else
        _terminalCB->setChecked(false);

    _uidCB->setChecked(df->readBoolEntry("X-TDE-SubstituteUID", false) || df->readBoolEntry("X-KDE-SubstituteUID", false));

    enableWidgets(true, entryInfo->hidden);
    blockSignals(false);
}