aboutsummaryrefslogtreecommitdiffstats
path: root/quitdialog.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-21 17:30:55 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-21 17:30:55 +0000
commit288b8c64e81cc1bb56bc591017c7df19aaa60998 (patch)
tree345f1fd14250be1cf26ac0ace8c5fde2aca8045b /quitdialog.cpp
parentnow saving multiple documents is nearly fine, but asking to save every single... (diff)
downloadgpg4usb-288b8c64e81cc1bb56bc591017c7df19aaa60998.tar.gz
gpg4usb-288b8c64e81cc1bb56bc591017c7df19aaa60998.zip
cleaned up a little
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@442 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'quitdialog.cpp')
-rwxr-xr-xquitdialog.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/quitdialog.cpp b/quitdialog.cpp
index 38cf14e..6e64065 100755
--- a/quitdialog.cpp
+++ b/quitdialog.cpp
@@ -66,7 +66,6 @@ QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs, QString
// tab-index in hidden column
QTableWidgetItem *tmp2 = new QTableWidgetItem(QString::number(i.key()));
mFileList->setItem(row, 2, tmp2);
- qDebug() << "tmp2:" << tmp2->text();
++row;
}
/*
@@ -83,15 +82,24 @@ QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs, QString
QWidget *warnBox = new QWidget(this);
warnBox->setLayout(warnBoxLayout);
+ /*
+ * Two labels on top and under the filelist
+ */
QLabel *checkLabel = new QLabel(tr("Check the files you want to save"));
-
QLabel *notelabel = new QLabel(tr("NOTE: If you don't save these files, all changes are lost.")+"\n");
+ /*
+ * Buttonbox
+ */
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Discard |QDialogButtonBox::Save | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
QPushButton* btnNoKey = buttonBox->button(QDialogButtonBox::Discard);
connect(btnNoKey, SIGNAL(clicked()), SLOT(myDiscard()));
+
+ /*
+ * Set the layout
+ */
QVBoxLayout *vbox = new QVBoxLayout();
vbox->addWidget(warnBox);
vbox->addWidget(checkLabel);
@@ -99,7 +107,6 @@ QuitDialog::QuitDialog(QWidget *parent, QHash<int, QString> unsavedDocs, QString
vbox->addWidget(notelabel);
vbox->addWidget(buttonBox);
this->setLayout(vbox);
-
}
@@ -119,7 +126,6 @@ QList <int> QuitDialog::getTabIdsToSave()
QList <int> tabIdsToSave;
for (int i = 0; i < mFileList->rowCount(); i++) {
if (mFileList->item(i, 0)->checkState() == Qt::Checked) {
- qDebug() << "tabidtosave: " << mFileList->item(i, 2)->text();
tabIdsToSave << mFileList->item(i, 2)->text().toInt();
}
}