TQString TDEStorageDevice::determineFileSystemType(TQString path) { TQStringList mountTable; TQString prevPath = path; dev_t prevDev = 0; int pos; struct stat directory_info; if (path.startsWith("/")) { stat(path.local8Bit(), &directory_info); prevDev = directory_info.st_dev; // Walk the directory tree up to the root, checking for any change in st_dev // If a change is found, the previous value of path is the mount point itself while (path != "/") { pos = path.findRev("/", -1, TRUE); if (pos < 0) { break; } path = path.mid(0, pos); if (path == "") { path = "/"; } stat(path.local8Bit(), &directory_info); if (directory_info.st_dev != prevDev) { break; } prevPath = path; prevDev = directory_info.st_dev; } } // Read in mount table mountTable.clear(); TQFile file( "/proc/mounts" ); if ( file.open( IO_ReadOnly ) ) { TQTextStream stream( &file ); while ( !stream.atEnd() ) { mountTable.append(stream.readLine()); } file.close(); } // Parse mount table TQStringList::Iterator it; for ( it = mountTable.begin(); it != mountTable.end(); ++it ) { TQStringList mountInfo = TQStringList::split(" ", (*it), true); if ((*mountInfo.at(1)) == prevPath) { return (*mountInfo.at(2)); } } // Unknown file system type return TQString::null; }
void KMDriverDB::loadDbFile() { // first clear everything m_entries.clear(); m_pnpentries.clear(); TQFile f(dbFile()); if (f.exists() && f.open(IO_ReadOnly)) { TQTextStream t(&f); TQString line; TQStringList words; KMDBEntry *entry(0); while (!t.eof()) { line = t.readLine().stripWhiteSpace(); if (line.isEmpty()) continue; int p = line.find('='); if (p == -1) continue; words.clear(); words << line.left(p) << line.mid(p+1); if (words[0] == "FILE") { if (entry) insertEntry(entry); entry = new KMDBEntry; entry->file = words[1]; } else if (words[0] == "MANUFACTURER" && entry) entry->manufacturer = words[1].upper(); else if (words[0] == "MODEL" && entry) entry->model = words[1]; else if (words[0] == "MODELNAME" && entry) entry->modelname = words[1]; else if (words[0] == "PNPMANUFACTURER" && entry) entry->pnpmanufacturer = words[1].upper(); else if (words[0] == "PNPMODEL" && entry) entry->pnpmodel = words[1]; else if (words[0] == "DESCRIPTION" && entry) entry->description = words[1]; else if (words[0] == "RECOMMANDED" && entry && words[1].lower() == "yes") entry->recommended = true; else if (words[0] == "DRIVERCOMMENT" && entry) entry->drivercomment = ("<qt>"+words[1].replace("<", "<").replace(">", ">")+"</qt>"); } if (entry) insertEntry(entry); } }
void KgpgView::encodetxt(TQStringList selec,TQStringList encryptOptions,bool, bool symmetric) { ////////////////// encode from editor if (KGpgSettings::pgpCompatibility()) encryptOptions<<"--pgp6"; if (symmetric) selec.clear(); KgpgInterface *txtCrypt=new KgpgInterface(); connect (txtCrypt,TQT_SIGNAL(txtencryptionfinished(TQString)),TQT_TQOBJECT(this),TQT_SLOT(updatetxt(TQString))); txtCrypt->KgpgEncryptText(editor->text(),selec,encryptOptions); //KMessageBox::sorry(0,"OVER"); //KgpgInterface::KgpgEncryptText(editor->text(),selec,encryptOptions); //if (!resultat.isEmpty()) editor->setText(resultat); //else KMessageBox::sorry(this,i18n("Decryption failed.")); }
void KateConfigDialog::addPluginPage (Kate::Plugin *plugin) { if (!Kate::pluginConfigInterfaceExtension(plugin)) return; for (uint i=0; i<Kate::pluginConfigInterfaceExtension(plugin)->configPages(); i++) { TQStringList path; path.clear(); path << i18n("Application")<<i18n("Plugins") << Kate::pluginConfigInterfaceExtension(plugin)->configPageName(i); TQVBox *page=addVBoxPage(path, Kate::pluginConfigInterfaceExtension(plugin)->configPageFullName(i), Kate::pluginConfigInterfaceExtension(plugin)->configPagePixmap(i, TDEIcon::SizeSmall)); PluginPageListItem *info=new PluginPageListItem; info->plugin = plugin; info->page = Kate::pluginConfigInterfaceExtension(plugin)->configPage (i, page); connect( info->page, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) ); pluginPages.append(info); } }
void KXmlCommandDlg::slotOk() { if (m_cmd) { m_cmd->setMimeType((m_mimetype->currentText() == "all/all" ? TQString::null : m_mimetype->currentText())); m_cmd->setDescription(m_description->text()); TQStringList l; TQListViewItem *item = m_requirements->firstChild(); while (item) { l << item->text(0); item = item->nextSibling(); } m_cmd->setRequirements(l); l.clear(); for (uint i=0; i<m_selectedmime->count(); i++) l << m_selectedmime->text(i); m_cmd->setInputMimeTypes(l); } KDialogBase::slotOk(); }
void DiskSensor::processExited(TDEProcess *) { TQStringList stringList = TQStringList::split('\n',sensorResult); sensorResult = ""; TQStringList::Iterator it = stringList.begin(); //TQRegExp rx( "^(/dev/).*(/\\S*)$"); TQRegExp rx( ".*\\s+(/\\S*)$"); while( it != stringList.end()) { rx.search( *it ); if ( !rx.cap(0).isEmpty()) { mntMap[rx.cap(1)] = *it; } it++; } stringList.clear(); TQString format; TQString mntPt; SensorParams *sp; Meter *meter; TQObjectListIt lit( *objList ); while (lit != 0) { sp = (SensorParams*)(*lit); meter = sp->getMeter(); format = sp->getParam("FORMAT"); mntPt = sp->getParam("MOUNTPOINT"); if (mntPt.length() == 0) mntPt="/"; if (format.length() == 0 ) { format = "%u"; } format.replace( TQRegExp("%fp", false),TQString::number(getPercentFree(mntPt))); format.replace( TQRegExp("%fg",false), TQString::number(getFreeSpace(mntPt)/(1024*1024))); format.replace( TQRegExp("%fkb",false), TQString::number(getFreeSpace(mntPt)*8) ); format.replace( TQRegExp("%fk",false), TQString::number(getFreeSpace(mntPt)) ); format.replace( TQRegExp("%f", false),TQString::number(getFreeSpace(mntPt)/1024)); format.replace( TQRegExp("%up", false),TQString::number(getPercentUsed(mntPt))); format.replace( TQRegExp("%ug",false), TQString::number(getUsedSpace(mntPt)/(1024*1024))); format.replace( TQRegExp("%ukb",false), TQString::number(getUsedSpace(mntPt)*8) ); format.replace( TQRegExp("%uk",false), TQString::number(getUsedSpace(mntPt)) ); format.replace( TQRegExp("%u", false),TQString::number(getUsedSpace(mntPt)/1024)); format.replace( TQRegExp("%tg",false), TQString::number(getTotalSpace(mntPt)/(1024*1024))); format.replace( TQRegExp("%tkb",false), TQString::number(getTotalSpace(mntPt)*8)); format.replace( TQRegExp("%tk",false), TQString::number(getTotalSpace(mntPt))); format.replace( TQRegExp("%t", false),TQString::number(getTotalSpace(mntPt)/1024)); meter->setValue(format); ++lit; } if ( init == 1 ) { emit initComplete(); init = 0; } }
KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, Kate::View *view ) : KDialogBase ( KDialogBase::TreeList, i18n("Configure"), KDialogBase::Ok | KDialogBase::Apply|KDialogBase::Cancel | KDialogBase::Help, KDialogBase::Ok, parent, "configdialog" ) { TDEConfig *config = KateApp::self()->config(); KWin::setIcons( winId(), KateApp::self()->icon(), KateApp::self()->miniIcon() ); actionButton( KDialogBase::Apply)->setEnabled( false ); mainWindow = parent; setMinimumSize(600,400); v = view; pluginPages.setAutoDelete (false); editorPages.setAutoDelete (false); TQStringList path; setShowIconsInTreeList(true); path.clear(); path << i18n("Application"); setFolderIcon (path, SmallIcon("kate", TDEIcon::SizeSmall)); path.clear(); //BEGIN General page path << i18n("Application") << i18n("General"); TQFrame* frGeneral = addPage(path, i18n("General Options"), BarIcon("go-home", TDEIcon::SizeSmall)); TQVBoxLayout *lo = new TQVBoxLayout( frGeneral ); lo->setSpacing(KDialog::spacingHint()); config->setGroup("General"); // GROUP with the one below: "Appearance" TQButtonGroup *bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("&Appearance"), frGeneral ); lo->addWidget( bgStartup ); // show full path in title config->setGroup("General"); cb_fullPath = new TQCheckBox( i18n("&Show full path in title"), bgStartup); cb_fullPath->setChecked( mainWindow->viewManager()->getShowFullPath() ); TQWhatsThis::add(cb_fullPath,i18n("If this option is checked, the full document path will be shown in the window caption.")); connect( cb_fullPath, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); // sort filelist if desired cb_sortFiles = new TQCheckBox(bgStartup); cb_sortFiles->setText(i18n("Sort &files alphabetically in the file list")); cb_sortFiles->setChecked(parent->filelist->sortType() == KateFileList::sortByName); TQWhatsThis::add( cb_sortFiles, i18n( "If this is checked, the files in the file list will be sorted alphabetically.") ); connect( cb_sortFiles, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); // GROUP with the one below: "Behavior" bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("&Behavior"), frGeneral ); lo->addWidget( bgStartup ); // number of recent files TQHBox *hbNrf = new TQHBox( bgStartup ); TQLabel *lNrf = new TQLabel( i18n("&Number of recent files:"), hbNrf ); sb_numRecentFiles = new TQSpinBox( 0, 1000, 1, hbNrf ); sb_numRecentFiles->setValue( mainWindow->fileOpenRecent->maxItems() ); lNrf->setBuddy( sb_numRecentFiles ); TQString numRecentFileHelpString ( i18n( "<qt>Sets the number of recent files remembered by Kate.<p><strong>NOTE: </strong>" "If you set this lower than the current value, the list will be truncated and " "some items forgotten.</qt>") ); TQWhatsThis::add( lNrf, numRecentFileHelpString ); TQWhatsThis::add( sb_numRecentFiles, numRecentFileHelpString ); connect( sb_numRecentFiles, TQT_SIGNAL( valueChanged ( int ) ), this, TQT_SLOT( slotChanged() ) ); // Use only one instance of kate (MDI) ? cb_useInstance = new TQCheckBox(bgStartup); cb_useInstance->setText(i18n("Always use the current instance of kate to open new files")); cb_useInstance->setChecked(parent->useInstance); TQWhatsThis::add( cb_useInstance, i18n( "When checked, all files opened from outside of Kate will only use the " "currently opened instance of Kate.") ); connect( cb_useInstance, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); // sync the konsole ? cb_syncKonsole = new TQCheckBox(bgStartup); cb_syncKonsole->setText(i18n("Sync &terminal emulator with active document")); cb_syncKonsole->setChecked(parent->syncKonsole); TQWhatsThis::add( cb_syncKonsole, i18n( "If this is checked, the built in Konsole will <code>cd</code> to the directory " "of the active document when started and whenever the active document changes, " "if the document is a local file.") ); connect( cb_syncKonsole, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); // modified files notification cb_modNotifications = new TQCheckBox( i18n("Wa&rn about files modified by foreign processes"), bgStartup ); cb_modNotifications->setChecked( parent->modNotification ); TQWhatsThis::add( cb_modNotifications, i18n( "If enabled, when Kate receives focus you will be asked what to do with " "files that have been modified on the hard disk. If not enabled, you will " "be asked what to do with a file that has been modified on the hard disk only " "when that file gains focus inside Kate.") ); connect( cb_modNotifications, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); // GROUP with the one below: "Meta-informations" bgStartup = new TQButtonGroup( 2, Qt::Horizontal, i18n("Meta-Information"), frGeneral ); lo->addWidget( bgStartup ); // save meta infos cb_saveMetaInfos = new TQCheckBox( bgStartup ); cb_saveMetaInfos->setText(i18n("Keep &meta-information past sessions")); cb_saveMetaInfos->setChecked(KateDocManager::self()->getSaveMetaInfos()); TQWhatsThis::add(cb_saveMetaInfos, i18n( "Check this if you want document configuration like for example " "bookmarks to be saved past editor sessions. The configuration will be " "restored if the document has not changed when reopened.")); connect( cb_saveMetaInfos, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); // meta infos days TQHBox *hbDmf = new TQHBox( bgStartup ); hbDmf->setEnabled(KateDocManager::self()->getSaveMetaInfos()); TQLabel *lDmf = new TQLabel( i18n("&Delete unused meta-information after:"), hbDmf ); sb_daysMetaInfos = new TQSpinBox( 0, 180, 1, hbDmf ); sb_daysMetaInfos->setSpecialValueText(i18n("(never)")); sb_daysMetaInfos->setSuffix(i18n(" day(s)")); sb_daysMetaInfos->setValue( KateDocManager::self()->getDaysMetaInfos() ); lDmf->setBuddy( sb_daysMetaInfos ); connect( cb_saveMetaInfos, TQT_SIGNAL( toggled( bool ) ), hbDmf, TQT_SLOT( setEnabled( bool ) ) ); connect( sb_daysMetaInfos, TQT_SIGNAL( valueChanged ( int ) ), this, TQT_SLOT( slotChanged() ) ); lo->addStretch(1); // :-] works correct without autoadd //END General page path.clear(); //BEGIN Session page path << i18n("Application") << i18n("Sessions"); TQFrame* frSessions = addPage(path, i18n("Session Management"), BarIcon("history", TDEIcon::SizeSmall)); lo = new TQVBoxLayout( frSessions ); lo->setSpacing(KDialog::spacingHint()); // GROUP with the one below: "Startup" bgStartup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Elements of Sessions"), frSessions ); lo->addWidget( bgStartup ); // restore view config cb_restoreVC = new TQCheckBox( bgStartup ); cb_restoreVC->setText(i18n("Include &window configuration")); config->setGroup("General"); cb_restoreVC->setChecked( config->readBoolEntry("Restore Window Configuration", true) ); TQWhatsThis::add(cb_restoreVC, i18n( "Check this if you want all your views and frames restored each time you open Kate")); connect( cb_restoreVC, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( slotChanged() ) ); TQRadioButton *rb1, *rb2, *rb3; sessions_start = new TQButtonGroup( 1, Qt::Horizontal, i18n("Behavior on Application Startup"), frSessions ); lo->add (sessions_start); sessions_start->setRadioButtonExclusive( true ); sessions_start->insert( rb1=new TQRadioButton( i18n("&Start new session"), sessions_start ), 0 ); sessions_start->insert( rb2=new TQRadioButton( i18n("&Load last-used session"), sessions_start ), 1 ); sessions_start->insert( rb3=new TQRadioButton( i18n("&Manually choose a session"), sessions_start ), 2 ); config->setGroup("General"); TQString sesStart (config->readEntry ("Startup Session", "manual")); if (sesStart == "new") sessions_start->setButton (0); else if (sesStart == "last") sessions_start->setButton (1); else sessions_start->setButton (2); connect(rb1, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged())); connect(rb2, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged())); connect(rb3, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged())); sessions_exit = new TQButtonGroup( 1, Qt::Horizontal, i18n("Behavior on Application Exit or Session Switch"), frSessions ); lo->add (sessions_exit); sessions_exit->setRadioButtonExclusive( true ); sessions_exit->insert( rb1=new TQRadioButton( i18n("&Do not save session"), sessions_exit ), 0 ); sessions_exit->insert( rb2=new TQRadioButton( i18n("&Save session"), sessions_exit ), 1 ); sessions_exit->insert( rb3=new TQRadioButton( i18n("&Ask user"), sessions_exit ), 2 ); config->setGroup("General"); TQString sesExit (config->readEntry ("Session Exit", "save")); if (sesExit == "discard") sessions_exit->setButton (0); else if (sesExit == "save") sessions_exit->setButton (1); else sessions_exit->setButton (2); connect(rb1, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged())); connect(rb2, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged())); connect(rb3, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotChanged())); lo->addStretch(1); // :-] works correct without autoadd //END Session page path.clear(); // file selector page path << i18n("Application") << i18n("File Selector"); TQVBox *page = addVBoxPage( path, i18n("File Selector Settings"), BarIcon("document-open", TDEIcon::SizeSmall) ); fileSelConfigPage = new KFSConfigPage( page, "file selector config page", mainWindow->fileselector ); connect( fileSelConfigPage, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) ); path.clear(); path << i18n("Application") << i18n("Document List"); page = addVBoxPage( path, i18n("Document List Settings"), BarIcon("view_text", TDEIcon::SizeSmall) ); filelistConfigPage = new KFLConfigPage( page, "file list config page", mainWindow->filelist ); connect( filelistConfigPage, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) ); path.clear(); path << i18n("Application") << i18n("Plugins"); /*TQVBox **/page=addVBoxPage(path,i18n("Plugin Manager"), BarIcon("connect_established",TDEIcon::SizeSmall)); KateConfigPluginPage *configPluginPage = new KateConfigPluginPage(page, this); connect( configPluginPage, TQT_SIGNAL( changed() ), TQT_TQOBJECT(this), TQT_SLOT( slotChanged() ) ); // Tools->External Tools menu path.clear(); path << i18n("Application") << i18n("External Tools"); page = addVBoxPage( path, i18n("External Tools"), BarIcon("configure", TDEIcon::SizeSmall) ); configExternalToolsPage = new KateExternalToolsConfigWidget(page, "external tools config page"); connect( configExternalToolsPage, TQT_SIGNAL(changed()), TQT_TQOBJECT(this), TQT_SLOT(slotChanged()) ); // editor widgets from kwrite/kwdialog path.clear(); path << i18n("Editor"); setFolderIcon (path, SmallIcon("edit", TDEIcon::SizeSmall)); for (uint i = 0; i < KTextEditor::configInterfaceExtension (v->document())->configPages (); i++) { path.clear(); path << i18n("Editor") << KTextEditor::configInterfaceExtension (v->document())->configPageName (i); /*TQVBox **/page = addVBoxPage(path, KTextEditor::configInterfaceExtension (v->document())->configPageFullName (i), KTextEditor::configInterfaceExtension (v->document())->configPagePixmap(i, TDEIcon::SizeSmall) ); KTextEditor::ConfigPage *cPage = KTextEditor::configInterfaceExtension (v->document())->configPage(i, page); connect( cPage, TQT_SIGNAL( changed() ), this, TQT_SLOT( slotChanged() ) ); editorPages.append (cPage); } KatePluginList &pluginList (KatePluginManager::self()->pluginList()); for (unsigned int i=0; i < pluginList.size(); ++i) { if ( pluginList[i].load && Kate::pluginConfigInterfaceExtension(pluginList[i].plugin) ) addPluginPage (pluginList[i].plugin); } enableButtonSeparator(true); dataChanged = false; unfoldTreeList (); }
void KMMainView::initActions() { TDEIconSelectAction *vact = new TDEIconSelectAction(i18n("&View"),0,m_actions,"view_change"); TQStringList iconlst; iconlst << "view_icon" << "view_detailed" << "view_tree"; vact->setItems(TQStringList::split(',',i18n("&Icons,&List,&Tree"),false), iconlst); vact->setCurrentItem(0); connect(vact,TQT_SIGNAL(activated(int)),TQT_SLOT(slotChangeView(int))); TDEActionMenu *stateAct = new TDEActionMenu(i18n("Start/Stop Printer"), "tdeprint_printstate", m_actions, "printer_state_change"); stateAct->setDelayed(false); stateAct->insert(new TDEAction(i18n("&Start Printer"),"tdeprint_enableprinter",0,TQT_TQOBJECT(this),TQT_SLOT(slotChangePrinterState()),m_actions,"printer_start")); stateAct->insert(new TDEAction(i18n("Sto&p Printer"),"tdeprint_stopprinter",0,TQT_TQOBJECT(this),TQT_SLOT(slotChangePrinterState()),m_actions,"printer_stop")); stateAct = new TDEActionMenu(i18n("Enable/Disable Job Spooling"), "tdeprint_queuestate", m_actions, "printer_spool_change"); stateAct->setDelayed(false); stateAct->insert(new TDEAction(i18n("&Enable Job Spooling"),"tdeprint_enableprinter",0,TQT_TQOBJECT(this),TQT_SLOT(slotChangePrinterState()),m_actions,"printer_enable")); stateAct->insert(new TDEAction(i18n("&Disable Job Spooling"),"tdeprint_stopprinter",0,TQT_TQOBJECT(this),TQT_SLOT(slotChangePrinterState()),m_actions,"printer_disable")); new TDEAction(i18n("&Remove"),"edittrash",0,TQT_TQOBJECT(this),TQT_SLOT(slotRemove()),m_actions,"printer_remove"); new TDEAction(i18n("&Configure..."),"configure",0,TQT_TQOBJECT(this),TQT_SLOT(slotConfigure()),m_actions,"printer_configure"); new TDEAction(i18n("Add &Printer/Class..."),"tdeprint_addprinter",0,TQT_TQOBJECT(this),TQT_SLOT(slotAdd()),m_actions,"printer_add"); new TDEAction(i18n("Add &Special (pseudo) Printer..."),"tdeprint_addpseudo",0,TQT_TQOBJECT(this),TQT_SLOT(slotAddSpecial()),m_actions,"printer_add_special"); new TDEAction(i18n("Set as &Local Default"),"tdeprint_defaulthard",0,TQT_TQOBJECT(this),TQT_SLOT(slotHardDefault()),m_actions,"printer_hard_default"); new TDEAction(i18n("Set as &User Default"),"tdeprint_defaultsoft",0,TQT_TQOBJECT(this),TQT_SLOT(slotSoftDefault()),m_actions,"printer_soft_default"); new TDEAction(i18n("&Test Printer..."),"tdeprint_testprinter",0,TQT_TQOBJECT(this),TQT_SLOT(slotTest()),m_actions,"printer_test"); new TDEAction(i18n("Configure &Manager..."),"tdeprint_configmgr",0,TQT_TQOBJECT(this),TQT_SLOT(slotManagerConfigure()),m_actions,"manager_configure"); new TDEAction(i18n("Initialize Manager/&View"),"reload",0,TQT_TQOBJECT(this),TQT_SLOT(slotInit()),m_actions,"view_refresh"); TDEIconSelectAction *dact = new TDEIconSelectAction(i18n("&Orientation"),0,m_actions,"orientation_change"); iconlst.clear(); iconlst << "view_top_bottom" << "view_left_right"; dact->setItems(TQStringList::split(',',i18n("&Vertical,&Horizontal"),false), iconlst); dact->setCurrentItem(0); connect(dact,TQT_SIGNAL(activated(int)),TQT_SLOT(slotChangeDirection(int))); new TDEAction(i18n("R&estart Server"),"tdeprint_restartsrv",0,TQT_TQOBJECT(this),TQT_SLOT(slotServerRestart()),m_actions,"server_restart"); new TDEAction(i18n("Configure &Server..."),"tdeprint_configsrv",0,TQT_TQOBJECT(this),TQT_SLOT(slotServerConfigure()),m_actions,"server_configure"); new TDEAction(i18n("Configure Server Access..."),"tdeprint_configsrv",0,TQT_TQOBJECT(this),TQT_SLOT(slotServerConfigureAccess()),m_actions,"server_access_configure"); TDEToggleAction *tact = new TDEToggleAction(i18n("Show &Toolbar"),0,m_actions,"view_toolbar"); tact->setCheckedState(i18n("Hide &Toolbar")); connect(tact,TQT_SIGNAL(toggled(bool)),TQT_SLOT(slotToggleToolBar(bool))); tact = new TDEToggleAction( i18n( "Show Me&nu Toolbar" ), 0, m_actions, "view_menubar" ); tact->setCheckedState(i18n("Hide Me&nu Toolbar")); connect( tact, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotToggleMenuBar( bool ) ) ); tact = new TDEToggleAction(i18n("Show Pr&inter Details"),"tdeprint_printer_infos", 0,m_actions,"view_printerinfos"); tact->setCheckedState(KGuiItem(i18n("Hide Pr&inter Details"),"tdeprint_printer_infos")); tact->setChecked(true); connect(tact,TQT_SIGNAL(toggled(bool)),TQT_SLOT(slotShowPrinterInfos(bool))); tact = new TDEToggleAction(i18n("Toggle Printer &Filtering"), "filter", 0, m_actions, "view_pfilter"); tact->setChecked(KMManager::self()->isFilterEnabled()); connect(tact, TQT_SIGNAL(toggled(bool)), TQT_SLOT(slotToggleFilter(bool))); new TDEAction( i18n( "%1 &Handbook" ).arg( "TDEPrint" ), "contents", 0, TQT_TQOBJECT(this), TQT_SLOT( slotHelp() ), m_actions, "invoke_help" ); new TDEAction( i18n( "%1 &Web Site" ).arg( "TDEPrint" ), "network", 0, TQT_TQOBJECT(this), TQT_SLOT( slotHelp() ), m_actions, "invoke_web" ); TDEActionMenu *mact = new TDEActionMenu(i18n("Pri&nter Tools"), "package_utilities", m_actions, "printer_tool"); mact->setDelayed(false); connect(mact->popupMenu(), TQT_SIGNAL(activated(int)), TQT_SLOT(slotToolSelected(int))); TQStringList files = TDEGlobal::dirs()->findAllResources("data", "tdeprint/tools/*.desktop"); for (TQStringList::ConstIterator it=files.begin(); it!=files.end(); ++it) { KSimpleConfig conf(*it); conf.setGroup("Desktop Entry"); mact->popupMenu()->insertItem(conf.readEntry("Name", "Unnamed"), mact->popupMenu()->count()); m_toollist << conf.readEntry("X-TDE-Library"); } // add actions to the toolbar m_actions->action("printer_add")->plug(m_toolbar); m_actions->action("printer_add_special")->plug(m_toolbar); m_toolbar->insertLineSeparator(); m_actions->action("printer_state_change")->plug(m_toolbar); m_actions->action("printer_spool_change")->plug(m_toolbar); m_toolbar->insertSeparator(); m_actions->action("printer_hard_default")->plug(m_toolbar); m_actions->action("printer_soft_default")->plug(m_toolbar); m_actions->action("printer_remove")->plug(m_toolbar); m_toolbar->insertSeparator(); m_actions->action("printer_configure")->plug(m_toolbar); m_actions->action("printer_test")->plug(m_toolbar); m_actions->action("printer_tool")->plug(m_toolbar); m_pactionsindex = m_toolbar->insertSeparator(); m_toolbar->insertLineSeparator(); m_actions->action("server_restart")->plug(m_toolbar); m_actions->action("server_configure")->plug(m_toolbar); m_toolbar->insertLineSeparator(); m_actions->action("manager_configure")->plug(m_toolbar); m_actions->action("view_refresh")->plug(m_toolbar); m_toolbar->insertLineSeparator(); m_actions->action("view_printerinfos")->plug(m_toolbar); m_actions->action("view_change")->plug(m_toolbar); m_actions->action("orientation_change")->plug(m_toolbar); m_actions->action("view_pfilter")->plug(m_toolbar); // add actions to the menu bar TQPopupMenu *menu = new TQPopupMenu( this ); m_actions->action( "printer_add" )->plug( menu ); m_actions->action( "printer_add_special" )->plug( menu ); //m_menubar->insertItem( i18n( "Add" ), menu ); m_menubar->insertButton( "wizard", 0, true, i18n( "Add" ) ); m_menubar->getButton( 0 )->setPopup( menu, true ); menu = new TQPopupMenu( this ); m_actions->action("printer_state_change")->plug( menu ); m_actions->action("printer_spool_change")->plug( menu ); menu->insertSeparator(); m_actions->action("printer_hard_default")->plug( menu ); m_actions->action("printer_soft_default")->plug( menu ); m_actions->action("printer_remove")->plug( menu ); menu->insertSeparator(); m_actions->action("printer_configure")->plug( menu ); m_actions->action("printer_test")->plug( menu ); m_actions->action("printer_tool")->plug( menu ); menu->insertSeparator(); //m_menubar->insertItem( i18n( "Printer" ), menu ); m_menubar->insertButton( "printer1", 1, true, i18n( "Printer" ) ); m_menubar->getButton( 1 )->setPopup( menu, true ); menu = new TQPopupMenu( this ); m_actions->action("server_restart")->plug( menu ); m_actions->action("server_configure")->plug( menu ); //m_menubar->insertItem( i18n( "Server" ), menu ); m_menubar->insertButton( "misc", 2, true, i18n( "Print Server" ) ); m_menubar->getButton( 2 )->setPopup( menu, true ); menu = new TQPopupMenu( this ); m_actions->action("manager_configure")->plug( menu ); m_actions->action("view_refresh")->plug( menu ); //m_menubar->insertItem( i18n( "Manager" ), menu ); m_menubar->insertButton( "tdeprint_configmgr", 3, true, i18n( "Print Manager" ) ); m_menubar->getButton( 3 )->setPopup( menu, true ); menu = new TQPopupMenu( this ); m_actions->action("view_printerinfos")->plug( menu ); m_actions->action("view_change")->plug( menu ); m_actions->action("orientation_change")->plug( menu ); m_actions->action( "view_toolbar" )->plug ( menu ); m_actions->action( "view_menubar" )->plug ( menu ); menu->insertSeparator(); m_actions->action("view_pfilter")->plug( menu ); //m_menubar->insertItem( i18n( "View" ), menu ); m_menubar->insertButton( "view_remove", 4, true, i18n( "View" ) ); m_menubar->getButton( 4 )->setPopup( menu, true ); //m_menubar->setMinimumHeight( m_menubar->heightForWidth( 1000 ) ); menu = new TQPopupMenu( this ); m_actions->action( "invoke_help" )->plug( menu ); m_actions->action( "invoke_web" )->plug( menu ); m_menubar->insertButton( "help", 5, true, i18n( "Documentation" ) ); m_menubar->getButton( 5 )->setPopup( menu, true ); loadPluginActions(); slotPrinterSelected(TQString::null); }
KWindowActionsConfig::KWindowActionsConfig (bool _standAlone, TDEConfig *_config, TQWidget * parent, const char *) : TDECModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) { TQString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3, strAllW; TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); TQGrid *grid; TQGroupBox *box; TQLabel *label; TQString strMouseButton1, strMouseButton3; TQString txtButton1, txtButton3; TQStringList items; bool leftHandedMouse = ( TDEGlobalSettings::mouseSettings().handed == TDEGlobalSettings::KMouseSettings::LeftHanded); /** Inactive inner window ******************/ box = new TQVGroupBox(i18n("Inactive Inner Window"), this, "Inactive Inner Window"); box->layout()->setMargin(KDialog::marginHint()); box->layout()->setSpacing(KDialog::spacingHint()); layout->addWidget(box); TQWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on an inactive" " inner window ('inner' means: not titlebar, not frame).") ); grid = new TQGrid(3, Qt::Vertical, box); strMouseButton1 = i18n("Left button:"); txtButton1 = i18n("In this row you can customize left click behavior when clicking into" " the titlebar or the frame."); strMouseButton3 = i18n("Right button:"); txtButton3 = i18n("In this row you can customize right click behavior when clicking into" " the titlebar or the frame." ); if ( leftHandedMouse ) { tqSwap(strMouseButton1, strMouseButton3); tqSwap(txtButton1, txtButton3); } strWin1 = i18n("In this row you can customize left click behavior when clicking into" " an inactive inner window ('inner' means: not titlebar, not frame)."); strWin3 = i18n("In this row you can customize right click behavior when clicking into" " an inactive inner window ('inner' means: not titlebar, not frame)."); // Be nice to lefties if ( leftHandedMouse ) tqSwap(strWin1, strWin3); label = new TQLabel(strMouseButton1, grid); TQWhatsThis::add( label, strWin1 ); label = new TQLabel(i18n("Middle button:"), grid); strWin2 = i18n("In this row you can customize middle click behavior when clicking into" " an inactive inner window ('inner' means: not titlebar, not frame)."); TQWhatsThis::add( label, strWin2 ); label = new TQLabel(strMouseButton3, grid); TQWhatsThis::add( label, strWin3 ); items.clear(); items << i18n("Activate, Raise & Pass Click") << i18n("Activate & Pass Click") << i18n("Activate") << i18n("Activate & Raise"); TQComboBox* combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coWin1 = combo; TQWhatsThis::add( combo, strWin1 ); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coWin2 = combo; TQWhatsThis::add( combo, strWin2 ); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coWin3 = combo; TQWhatsThis::add( combo, strWin3 ); /** Inner window, titlebar and frame **************/ box = new TQVGroupBox(i18n("Inner Window, Titlebar && Frame"), this, "Inner Window, Titlebar and Frame"); box->layout()->setMargin(KDialog::marginHint()); box->layout()->setSpacing(KDialog::spacingHint()); layout->addWidget(box); TQWhatsThis::add( box, i18n("Here you can customize TDE's behavior when clicking somewhere into" " a window while pressing a modifier key.")); grid = new TQGrid(5, Qt::Vertical, box); // Labels label = new TQLabel(i18n("Modifier key:"), grid); strAllKey = i18n("Here you select whether holding the Meta key or Alt key " "will allow you to perform the following actions."); TQWhatsThis::add( label, strAllKey ); strMouseButton1 = i18n("Modifier key + left button:"); strAll1 = i18n("In this row you can customize left click behavior when clicking into" " the titlebar or the frame."); strMouseButton3 = i18n("Modifier key + right button:"); strAll3 = i18n("In this row you can customize right click behavior when clicking into" " the titlebar or the frame." ); if ( leftHandedMouse ) { tqSwap(strMouseButton1, strMouseButton3); tqSwap(strAll1, strAll3); } label = new TQLabel(strMouseButton1, grid); TQWhatsThis::add( label, strAll1); label = new TQLabel(i18n("Modifier key + middle button:"), grid); strAll2 = i18n("Here you can customize TDE's behavior when middle clicking into a window" " while pressing the modifier key."); TQWhatsThis::add( label, strAll2 ); label = new TQLabel(strMouseButton3, grid); TQWhatsThis::add( label, strAll3); label = new TQLabel(i18n("Modifier key + mouse wheel:"), grid); strAllW = i18n("Here you can customize TDE's behavior when scrolling with the mouse wheel" " in a window while pressing the modifier key."); TQWhatsThis::add( label, strAllW); // Combo's combo = new TQComboBox(grid); combo->insertItem(i18n("Meta")); combo->insertItem(i18n("Alt")); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coAllKey = combo; TQWhatsThis::add( combo, strAllKey ); items.clear(); items << i18n("Move") << i18n("Activate, Raise and Move") << i18n("Toggle Raise & Lower") << i18n("Resize") << i18n("Raise") << i18n("Lower") << i18n("Minimize") << i18n("Nothing"); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coAll1 = combo; TQWhatsThis::add( combo, strAll1 ); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coAll2 = combo; TQWhatsThis::add( combo, strAll2 ); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coAll3 = combo; TQWhatsThis::add( combo, strAll3 ); combo = new TQComboBox(grid); combo->insertItem(i18n("Raise/Lower")); combo->insertItem(i18n("Shade/Unshade")); combo->insertItem(i18n("Maximize/Restore")); combo->insertItem(i18n("Keep Above/Below")); combo->insertItem(i18n("Move to Previous/Next Desktop")); combo->insertItem(i18n("Change Opacity")); combo->insertItem(i18n("Nothing")); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coAllW = combo; TQWhatsThis::add( combo, strAllW ); layout->addStretch(); load(); }
KTitleBarActionsConfig::KTitleBarActionsConfig (bool _standAlone, TDEConfig *_config, TQWidget * parent, const char *) : TDECModule(parent, "kcmkwm"), config(_config), standAlone(_standAlone) { TQString strWin1, strWin2, strWin3, strAllKey, strAll1, strAll2, strAll3; TQVBoxLayout *layout = new TQVBoxLayout(this, 0, KDialog::spacingHint()); TQGrid *grid; TQGroupBox *box; TQLabel *label; TQString strMouseButton1, strMouseButton3, strMouseWheel; TQString txtButton1, txtButton3, txtButton4; TQStringList items; bool leftHandedMouse = ( TDEGlobalSettings::mouseSettings().handed == TDEGlobalSettings::KMouseSettings::LeftHanded); /** Titlebar doubleclick ************/ TQHBoxLayout *hlayout = new TQHBoxLayout(layout); label = new TQLabel(i18n("&Titlebar double-click:"), this); hlayout->addWidget(label); TQWhatsThis::add( label, i18n("Here you can customize mouse click behavior when double clicking on the" " titlebar of a window.") ); TQComboBox* combo = new TQComboBox(this); combo->insertItem(i18n("Maximize")); combo->insertItem(i18n("Maximize (vertical only)")); combo->insertItem(i18n("Maximize (horizontal only)")); combo->insertItem(i18n("Minimize")); combo->insertItem(i18n("Shade")); combo->insertItem(i18n("Lower")); combo->insertItem(i18n("On All Desktops")); combo->insertItem(i18n("Nothing")); combo->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); hlayout->addWidget(combo); coTiDbl = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>double</em> click into the titlebar.")); label->setBuddy(combo); /** Mouse Wheel Events **************/ TQHBoxLayout *hlayoutW = new TQHBoxLayout(layout); strMouseWheel = i18n("Titlebar wheel event:"); label = new TQLabel(strMouseWheel, this); hlayoutW->addWidget(label); txtButton4 = i18n("Handle mouse wheel events"); TQWhatsThis::add( label, txtButton4); // Titlebar and frame mouse Wheel TQComboBox* comboW = new TQComboBox(this); comboW->insertItem(i18n("Raise/Lower")); comboW->insertItem(i18n("Shade/Unshade")); comboW->insertItem(i18n("Maximize/Restore")); comboW->insertItem(i18n("Keep Above/Below")); comboW->insertItem(i18n("Move to Previous/Next Desktop")); comboW->insertItem(i18n("Change Opacity")); comboW->insertItem(i18n("Nothing")); comboW->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Fixed)); connect(comboW, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); hlayoutW->addWidget(comboW); coTiAct4 = comboW; TQWhatsThis::add(comboW, txtButton4); label->setBuddy(comboW); /** Titlebar and frame **************/ box = new TQVGroupBox( i18n("Titlebar && Frame"), this, "Titlebar and Frame"); box->layout()->setMargin(KDialog::marginHint()); box->layout()->setSpacing(KDialog::spacingHint()); layout->addWidget(box); TQWhatsThis::add( box, i18n("Here you can customize mouse click behavior when clicking on the" " titlebar or the frame of a window.") ); grid = new TQGrid(4, Qt::Vertical, box); new TQLabel(grid); // dummy strMouseButton1 = i18n("Left button:"); txtButton1 = i18n("In this row you can customize left click behavior when clicking into" " the titlebar or the frame."); strMouseButton3 = i18n("Right button:"); txtButton3 = i18n("In this row you can customize right click behavior when clicking into" " the titlebar or the frame." ); if ( leftHandedMouse ) { tqSwap(strMouseButton1, strMouseButton3); tqSwap(txtButton1, txtButton3); } label = new TQLabel(strMouseButton1, grid); TQWhatsThis::add( label, txtButton1); label = new TQLabel(i18n("Middle button:"), grid); TQWhatsThis::add( label, i18n("In this row you can customize middle click behavior when clicking into" " the titlebar or the frame.") ); label = new TQLabel(strMouseButton3, grid); TQWhatsThis::add( label, txtButton3); label = new TQLabel(i18n("Active"), grid); label->setAlignment(AlignCenter); TQWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar" " or the frame of an active window.") ); // Titlebar and frame, active, mouse button 1 combo = new TQComboBox(grid); combo->insertItem(i18n("Raise")); combo->insertItem(i18n("Lower")); combo->insertItem(i18n("Operations Menu")); combo->insertItem(i18n("Toggle Raise & Lower")); combo->insertItem(i18n("Nothing")); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coTiAct1 = combo; txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an " "<em>active</em> window."); txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an " "<em>active</em> window."); // Be nice to left handed users if ( leftHandedMouse ) tqSwap(txtButton1, txtButton3); TQWhatsThis::add(combo, txtButton1); // Titlebar and frame, active, mouse button 2 items << i18n("Raise") << i18n("Lower") << i18n("Operations Menu") << i18n("Toggle Raise & Lower") << i18n("Nothing") << i18n("Shade"); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coTiAct2 = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>active</em> window.")); // Titlebar and frame, active, mouse button 3 combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coTiAct3 = combo; TQWhatsThis::add(combo, txtButton3 ); txtButton1 = i18n("Behavior on <em>left</em> click into the titlebar or frame of an " "<em>inactive</em> window."); txtButton3 = i18n("Behavior on <em>right</em> click into the titlebar or frame of an " "<em>inactive</em> window."); // Be nice to left handed users if ( leftHandedMouse ) tqSwap(txtButton1, txtButton3); label = new TQLabel(i18n("Inactive"), grid); label->setAlignment(AlignCenter); TQWhatsThis::add( label, i18n("In this column you can customize mouse clicks into the titlebar" " or the frame of an inactive window.") ); items.clear(); items << i18n("Activate & Raise") << i18n("Activate & Lower") << i18n("Activate") << i18n("Shade") << i18n("Operations Menu") << i18n("Raise") << i18n("Lower") << i18n("Nothing"); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coTiInAct1 = combo; TQWhatsThis::add(combo, txtButton1); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coTiInAct2 = combo; TQWhatsThis::add(combo, i18n("Behavior on <em>middle</em> click into the titlebar or frame of an <em>inactive</em> window.")); combo = new TQComboBox(grid); combo->insertStringList(items); connect(combo, TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); coTiInAct3 = combo; TQWhatsThis::add(combo, txtButton3); /** Maximize Button ******************/ box = new TQHGroupBox(i18n("Maximize Button"), this, "Maximize Button"); box->layout()->setMargin(KDialog::marginHint()); box->layout()->setSpacing(KDialog::spacingHint()); layout->addWidget(box); TQWhatsThis::add( box, i18n("Here you can customize behavior when clicking on the maximize button.") ); TQString strMouseButton[] = { i18n("Left button:"), i18n("Middle button:"), i18n("Right button:")}; TQString txtButton[] = { i18n("Behavior on <em>left</em> click onto the maximize button." ), i18n("Behavior on <em>middle</em> click onto the maximize button." ), i18n("Behavior on <em>right</em> click onto the maximize button." )}; if ( leftHandedMouse ) // Be nice to lefties { tqSwap(strMouseButton[0], strMouseButton[2]); tqSwap(txtButton[0], txtButton[2]); } createMaxButtonPixmaps(); for (int b = 0; b < 3; ++b) { if (b != 0) new TQWidget(box); // Spacer TQLabel * label = new TQLabel(strMouseButton[b], box); TQWhatsThis::add( label, txtButton[b] ); label ->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum )); coMax[b] = new ToolTipComboBox(box, tbl_Max); for (int t = 0; t < 3; ++t) coMax[b]->insertItem(maxButtonPixmaps[t]); connect(coMax[b], TQT_SIGNAL(activated(int)), TQT_SLOT(changed())); connect(coMax[b], TQT_SIGNAL(activated(int)), coMax[b], TQT_SLOT(changed())); TQWhatsThis::add( coMax[b], txtButton[b] ); coMax[b]->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Minimum )); } connect(kapp, TQT_SIGNAL(tdedisplayPaletteChanged()), TQT_SLOT(paletteChanged())); layout->addStretch(); load(); }