]> git.sur5r.net Git - bacula/bacula/commitdiff
Make table widget items read only again.
authorDirk H Bartley <dbartley@schupan.com>
Sun, 22 Mar 2009 14:50:18 +0000 (14:50 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sun, 22 Mar 2009 14:50:18 +0000 (14:50 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8581 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/clients/clients.cpp
bacula/src/qt-console/fileset/fileset.cpp
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/jobs/jobs.cpp
bacula/src/qt-console/restore/prerestore.cpp

index 95c589254939f85bc201a73faec4953cd801d9e9..eb05df07e8e554a377675bcff5f3995fc0986d8c 100644 (file)
@@ -162,6 +162,16 @@ void Clients::populateTable()
    /* Resize rows and columns */
    tableWidget->resizeColumnsToContents();
    tableWidget->resizeRowsToContents();
+
+   /* make read only */
+   int rcnt = tableWidget->rowCount();
+   int ccnt = tableWidget->columnCount();
+   for(int r=0; r < rcnt; r++) {
+      for(int c=0; c < ccnt; c++) {
+         QTableWidgetItem* item = tableWidget->item(r, c);
+         item->setFlags(Qt::ItemFlags(item->flags() & (~Qt::ItemIsEditable)));
+      }
+   }
 }
 
 /*
index 57b309a78647e179ca7e245d70e8c6b8bdda745c..30d90a9e2f4b48e9be3c9ad2612693a2d2ac703e 100644 (file)
@@ -149,6 +149,16 @@ void FileSet::populateTable()
    /* Resize rows and columns */
    tableWidget->resizeColumnsToContents();
    tableWidget->resizeRowsToContents();
+
+   /* make read only */
+   int rcnt = tableWidget->rowCount();
+   int ccnt = tableWidget->columnCount();
+   for(int r=0; r < rcnt; r++) {
+      for(int c=0; c < ccnt; c++) {
+         QTableWidgetItem* item = tableWidget->item(r, c);
+         item->setFlags(Qt::ItemFlags(item->flags() & (~Qt::ItemIsEditable)));
+      }
+   }
 }
 
 /*
index 5b9d48906bd3d4048c688dba2a294697a9dccac1..0c9d330250998c467a3880cf6629b54ccb62636f 100644 (file)
@@ -218,6 +218,16 @@ void JobList::populateTable()
           tr("The Jobs query returned no results.\n"
          "Press OK to continue?"), QMessageBox::Ok );
    }
+
+   /* make read only */
+   int rcnt = mp_tableWidget->rowCount();
+   int ccnt = mp_tableWidget->columnCount();
+   for(int r=0; r < rcnt; r++) {
+      for(int c=0; c < ccnt; c++) {
+         QTableWidgetItem* item = mp_tableWidget->item(r, c);
+         item->setFlags(Qt::ItemFlags(item->flags() & (~Qt::ItemIsEditable)));
+      }
+   }
 }
 
 void JobList::prepareFilterWidgets()
index f79e960cae53bf8ecf5106d9e01cb158a6f53724..b8e9ffb08ab0b03c7e5c073c547dfc1c70eed6e1 100644 (file)
@@ -123,6 +123,16 @@ void Jobs::populateTable()
    /* Resize rows and columns */
    tableWidget->resizeColumnsToContents();
    tableWidget->resizeRowsToContents();
+
+   /* make read only */
+   int rcnt = tableWidget->rowCount();
+   int ccnt = tableWidget->columnCount();
+   for(int r=0; r < rcnt; r++) {
+      for(int c=0; c < ccnt; c++) {
+         QTableWidgetItem* item = tableWidget->item(r, c);
+         item->setFlags(Qt::ItemFlags(item->flags() & (~Qt::ItemIsEditable)));
+      }
+   }
 }
 
 /*
index 88f296b326bc006c93b12a45325a4e51c352212b..e78dd5deddc90d2097ac419ee60e87b3ad8c315d 100644 (file)
@@ -202,7 +202,7 @@ void prerestorePage::job_name_change(int index)
 
    (void)index;
    job_defs.job_name = jobCombo->currentText();
-   if (m_console->get_job_defaults(job_defs)) {
+   if (m_console->get_job_defaults(m_conn, job_defs)) {
       filesetCombo->setCurrentIndex(filesetCombo->findText(job_defs.fileset_name, Qt::MatchExactly));
       clientCombo->setCurrentIndex(clientCombo->findText(job_defs.client_name, Qt::MatchExactly));
       poolCombo->setCurrentIndex(poolCombo->findText(tr("Any"), Qt::MatchExactly));
@@ -240,7 +240,7 @@ int prerestorePage::jobdefsFromJob(QStringList &fieldlist, QString &jobId)
    " AND JobId=\'" + jobId + "\'";
    if (mainWin->m_sqlDebug) { Pmsg1(000, "query = %s\n", query.toUtf8().data()); }
    QStringList results;
-   if (m_console->sql_cmd(query, results)) {
+   if (m_console->sql_cmd(m_conn, query, results)) {
       QString field;
 
       /* Iterate through the lines of results, there should only be one. */