summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmview.cpp16
-rw-r--r--pwmanager/pwmanager/pwmview.h10
2 files changed, 20 insertions, 6 deletions
diff --git a/pwmanager/pwmanager/pwmview.cpp b/pwmanager/pwmanager/pwmview.cpp
index 58c2fca..d192119 100644
--- a/pwmanager/pwmanager/pwmview.cpp
+++ b/pwmanager/pwmanager/pwmview.cpp
@@ -15,54 +15,58 @@
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#include "pwmview.h"
#include "pwmexception.h"
#include "globalstuff.h"
#include "pwm.h"
#include "rencatwnd.h"
#ifndef PWM_EMBEDDED
#include "configuration.h"
#else
#include "pwmprefs.h"
#endif
#include "commentbox.h"
#include <kmessagebox.h>
#include <klocale.h>
#include <qlineedit.h>
#include <qpoint.h>
#include <qapplication.h>
+//US ENH: wouldn't it be a good idea if we could use this consts everywhere else.
+//US ENH: for examle in listviewpwm.cpp
+//US ENH: Because of that I transfer them into the headerfile.
+/*
#define COLUMN_DESC 0
#define COLUMN_NAME 1
#define COLUMN_PW 2
#define COLUMN_URL 3
#define COLUMN_LAUNCHER 4
-
+*/
PwMView::PwMView(PwM *_mainClass,
QWidget *parent, PwMDoc *_doc,
const char *name)
: PwMViewStyle(parent, name)
{
PWM_ASSERT(_mainClass);
PWM_ASSERT(parent);
PWM_ASSERT(_doc);
setView(this);
doc = _doc;
doc->setListViewPointer(this);
mainClass = _mainClass;
resize(_mainClass->size());
initStyle(conf()->confWndMainViewStyle());
initCtxMenu();
doc->setCurrentView(this);
connect(doc, SIGNAL(dataChanged(PwMDoc *)), this, SLOT(updateView()));
}
PwMView::~PwMView()
{
}
@@ -344,53 +348,53 @@ void PwMView::selAt(int index)
void PwMView::renCatButton_slot()
{
if (doc->isDeepLocked())
return;
RenCatWnd wnd(this);
if (wnd.exec() == 1) {
QString newName(wnd.getNewName());
if (newName == "")
return;
document()->renameCategory(getCurrentCategory(),
newName);
}
}
void PwMView::delCatButton_slot()
{
if (doc->isDeepLocked())
return;
if (numCategories() <= 1) {
mainClass->showStatMsg(i18n("Can't remove the last category."));
return;
}
if (KMessageBox::questionYesNo(this,
- i18n("Do you really want to "
- "delete the selected "
- "category? All password-"
- "entries will be lost in "
- "this category!"),
+ i18n("Do you really want to\n"
+ "delete the selected\n"
+ "category? All password-\n"
+ "entries will be lost in\n"
+ "this category!\n"),
i18n("Delete category?"))
== KMessageBox::No) {
return;
}
document()->delCategory(getCurrentCategory());
}
void PwMView::copyPwToClip()
{
if (doc->isDeepLocked())
return;
unsigned int curIndex = 0;
if (!getCurEntryIndex(&curIndex))
return;
PwMDataItem d;
document()->getDataChangedLock();
document()->getEntry(getCurrentCategory(), curIndex, &d, true);
document()->putDataChangedLock();
PwM::copyToClipboard(d.pw.c_str());
}
void PwMView::copyNameToClip()
{
if (doc->isDeepLocked())
diff --git a/pwmanager/pwmanager/pwmview.h b/pwmanager/pwmanager/pwmview.h
index b4cec65..5a326d3 100644
--- a/pwmanager/pwmanager/pwmview.h
+++ b/pwmanager/pwmanager/pwmview.h
@@ -1,46 +1,56 @@
/***************************************************************************
* *
* copyright (C) 2003, 2004 by Michael Buesch *
* email: mbuesch@freenet.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 2 *
* as published by the Free Software Foundation. *
* *
***************************************************************************/
/***************************************************************************
* copyright (C) 2004 by Ulf Schenk
* This file is originaly based on version 1.0.1 of pwmanager
* and was modified to run on embedded devices that run microkde
*
* $Id$
**************************************************************************/
#ifndef PWMVIEW_H
#define PWMVIEW_H
+//US ENH: wouldn't it be a good idea if we could use this consts everywhere else.
+//US ENH: for examle in listviewpwm.cpp
+//US ENH: Because of that I transfer them into the headerfile.
+#define COLUMN_DESC 0
+#define COLUMN_NAME 1
+#define COLUMN_PW 2
+#define COLUMN_URL 3
+#define COLUMN_LAUNCHER 4
+
+
#include "listviewpwm.h"
#include "pwmdoc.h"
#include "pwmviewstyle.h"
#include <kconfig.h>
#include <klocale.h>
#include <qevent.h>
#include <qfont.h>
#include <qobject.h>
#include <vector>
#include <string>
using std::string;
using std::vector;
class PwM;
class ConfFile;
class PwMStatusBar;
/** View class for PwM */
class PwMView : public PwMViewStyle