Пример #1
0
MoodPlugin::MoodPlugin( QObject *parent, const char *name,
			      const QStringList &/*args*/ )
	: ktagebuchPlugin( parent, name )
{
	
	connect( ktagebuchapp, SIGNAL(saveEntry()),
		 SLOT(saveEntry()) );
	connect( ktagebuchapp, SIGNAL(loadEntry()),
		 SLOT(loadEntry()) );
	
        this->fileSystem=ktagebuchapp->getFileSystem();		
	mPrefs=new MoodPreferences("looknfeel",this);	
}
Пример #2
0
EditEntryWidget::EditEntryWidget(QWidget* parent)
    : EditWidget(parent)
    , m_entry(Q_NULLPTR)
    , m_mainUi(new Ui::EditEntryWidgetMain())
    , m_advancedUi(new Ui::EditEntryWidgetAdvanced())
    , m_autoTypeUi(new Ui::EditEntryWidgetAutoType())
    , m_historyUi(new Ui::EditEntryWidgetHistory())
    , m_mainWidget(new QWidget())
    , m_advancedWidget(new QWidget())
    , m_iconsWidget(new EditWidgetIcons())
    , m_autoTypeWidget(new QWidget())
    , m_editWidgetProperties(new EditWidgetProperties())
    , m_historyWidget(new QWidget())
    , m_entryAttachments(new EntryAttachments(this))
    , m_attachmentsModel(new EntryAttachmentsModel(m_advancedWidget))
    , m_entryAttributes(new EntryAttributes(this))
    , m_attributesModel(new EntryAttributesModel(m_advancedWidget))
    , m_historyModel(new EntryHistoryModel(this))
    , m_sortModel(new QSortFilterProxyModel(this))
    , m_autoTypeAssoc(new AutoTypeAssociations(this))
    , m_autoTypeAssocModel(new AutoTypeAssociationsModel(this))
    , m_autoTypeDefaultSequenceGroup(new QButtonGroup(this))
    , m_autoTypeWindowSequenceGroup(new QButtonGroup(this))
{
    setupMain();
    setupAdvanced();
    setupIcon();
    setupAutoType();
    setupProperties();
    setupHistory();

    connect(this, SIGNAL(accepted()), SLOT(saveEntry()));
    connect(this, SIGNAL(rejected()), SLOT(cancel()));
}
Пример #3
0
/* EntryPanel::onToolbarButton
 * Called when a button on the toolbar is clicked
 *******************************************************************/
void EntryPanel::onToolbarButton(wxCommandEvent& e)
{
	string button = e.GetString();

	// Save
	if (button == "save")
	{
		if (modified)
		{
			if (undo_manager)
			{
				undo_manager->beginRecord("Save Entry Modifications");
				undo_manager->recordUndoStep(new EntryDataUS(entry));
			}

			if (saveEntry())
			{
				modified = false;
				if (undo_manager)
					undo_manager->endRecord(true);
			}
			else if (undo_manager)
				undo_manager->endRecord(false);
		}
	}

	// Revert
	else if (button == "revert")
	{
		revertEntry();
	}

	else
		toolbarButtonClick(button);
}
Пример #4
0
/* EntryPanel::onBtnSave
 * Called when the 'Save Changes' button is clicked
 *******************************************************************/
void EntryPanel::onBtnSave(wxCommandEvent& e) {
	if (modified) {
		if (undo_manager) {
			undo_manager->beginRecord("Save Entry Modifications");
			undo_manager->recordUndoStep(new EntryDataUS(entry));
		}

		if (saveEntry()) {
			modified = false;
			if (undo_manager)
				undo_manager->endRecord(true);
		}
		else if (undo_manager)
			undo_manager->endRecord(false);
	}
}
void OPimContactAccessBackend_XML::updateJournal( const OPimContact& cnt,
                           OPimRecord::ChangeAction action )
{
    if( !m_journalEnabled || m_journalName.isEmpty() )
        return;

    QFile f( m_journalName );
    bool created = !f.exists();
    if ( !f.open(IO_WriteOnly|IO_Append) )
        return;

    QString buf;
    QCString str;

    QAsciiDict<int> dict(OPimEvent::FRecChildren+1);
    initDict( dict );
    QIntDict<QString> revdict( dict.size() );
    revdict.setAutoDelete( true );
    // Now we need to reverse the dictionary (!)
    for( QAsciiDictIterator<int> it( dict ); it.current(); ++it ) {
        revdict.insert( (*it), new QString( it.currentKey() ) );
    }
    
    // if the file was created, we have to set the Tag "<CONTACTS>" to
    // get a XML-File which is readable by our parser.
    // This is just a cheat, but better than rewrite the parser.
    if ( created ) {
        buf = "<Contacts>";
        QCString cstr = buf.utf8();
        f.writeBlock( cstr.data(), cstr.length() );
    }

    buf = "<Contact ";
    saveEntry( &cnt, revdict, buf );
    buf += " action=\"" + QString::number( (int)action ) + "\" ";
    buf += "/>\n";
    QCString cstr = buf.utf8();
    f.writeBlock( cstr.data(), cstr.length() );
}
bool OPimContactAccessBackend_XML::write( OAbstractWriter &wr )
{
    QAsciiDict<int> dict(OPimEvent::FRecChildren+1);
    initDict( dict );
    QIntDict<QString> revdict( dict.size() );
    revdict.setAutoDelete( true );
    // Now we need to reverse the dictionary (!)
    for( QAsciiDictIterator<int> it( dict ); it.current(); ++it ) {
        revdict.insert( (*it), new QString( it.currentKey() ) );
    }

    // Write Header
    QString out = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!DOCTYPE Addressbook ><AddressBook>\n"
        " <Groups>\n"
        " </Groups>\n"
        " <Contacts>\n";
    QCString cstr = out.utf8();
    if ( !wr.writeString( cstr ) )
        return false;

    // Write all contacts
    QListIterator<OPimContact> it( m_contactList );
    for ( ; it.current(); ++it ) {
        out = "<Contact ";
        saveEntry( (*it), revdict, out );
        out += "/>\n";
        cstr = out.utf8();
        if ( !wr.writeString( cstr ) )
            return false;
    }

    // Write Footer
    out = " </Contacts>\n</AddressBook>\n";
    cstr = out.utf8();
    if ( !wr.writeString( cstr ) )
        return false;

    return true;
}
Пример #7
0
TDEWalletEditor::TDEWalletEditor(const TQString& wallet, bool isPath, TQWidget *parent, const char *name)
: TDEMainWindow(parent, name), _walletName(wallet), _nonLocal(isPath) {
	_newWallet = false;
	_ww = new WalletWidget(this, "Wallet Widget");
	_copyPassAction = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copyPassword()), actionCollection());

	TQVBoxLayout *box = new TQVBoxLayout(_ww->_entryListFrame);
	box->setSpacing( KDialog::spacingHint() );
	box->setMargin( KDialog::marginHint() );
	_entryList = new TDEWalletEntryList(_ww->_entryListFrame, "Wallet Entry List");
	box->addWidget(new TDEListViewSearchLineWidget(_entryList, _ww->_entryListFrame));
	box->addWidget(_entryList);

	_ww->_entryStack->setEnabled(true);

	box = new TQVBoxLayout(_ww->_entryStack->widget(2));
	_mapEditorShowHide = new TQCheckBox(i18n("&Show values"), _ww->_entryStack->widget(2));
	connect(_mapEditorShowHide, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showHideMapEditorValue(bool)));
	_mapEditor = new KWMapEditor(_currentMap, _ww->_entryStack->widget(2));
	box->addWidget(_mapEditorShowHide);
	box->addWidget(_mapEditor);

	setCentralWidget(_ww);

	resize(600, 400);

	connect(_entryList, TQT_SIGNAL(selectionChanged(TQListViewItem*)),
		this, TQT_SLOT(entrySelectionChanged(TQListViewItem*)));
	connect(_entryList,
		TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&,int)),
		this,
		TQT_SLOT(listContextMenuRequested(TQListViewItem*,const TQPoint&,int)));
	connect(_entryList,
		TQT_SIGNAL(itemRenamed(TQListViewItem*, int, const TQString&)),
		this,
		TQT_SLOT(listItemRenamed(TQListViewItem*, int, const TQString&)));

	connect(_ww->_passwordValue, TQT_SIGNAL(textChanged()),
		this, TQT_SLOT(entryEditted()));
	connect(_mapEditor, TQT_SIGNAL(dirty()),
		this, TQT_SLOT(entryEditted()));

	connect(_ww->_undoChanges, TQT_SIGNAL(clicked()),
		this, TQT_SLOT(restoreEntry()));
	connect(_ww->_saveChanges, TQT_SIGNAL(clicked()),
		this, TQT_SLOT(saveEntry()));

	connect(_ww->_showContents, TQT_SIGNAL(clicked()),
		this, TQT_SLOT(showPasswordContents()));
	connect(_ww->_hideContents, TQT_SIGNAL(clicked()),
		this, TQT_SLOT(hidePasswordContents()));

	_walletIsOpen = false;

	_w = TDEWallet::Wallet::openWallet(wallet, winId(), isPath ? TDEWallet::Wallet::Path : TDEWallet::Wallet::Asynchronous);
	if (_w) {
		connect(_w, TQT_SIGNAL(walletOpened(bool)), this, TQT_SLOT(walletOpened(bool)));
		connect(_w, TQT_SIGNAL(walletClosed()), this, TQT_SLOT(walletClosed()));
		connect(_w, TQT_SIGNAL(folderUpdated(const TQString&)), this, TQT_SLOT(updateEntries(const TQString&)));
		connect(_w, TQT_SIGNAL(folderListUpdated()), this, TQT_SLOT(updateFolderList()));
		updateFolderList();
	} else {