]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/gui/conferenceeditor.cpp
Bump copyright years.
[toast/confclerk.git] / src / gui / conferenceeditor.cpp
index b61aa486aa822f182f40b3e83bee6bc0d01b055b..d93deee7783a3c23779602f64617156754039765 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
 /*
  * Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011-2013 Philipp Spitzer, gregor herrmann, Stefan Stahl
+ * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
  * This file is part of ConfClerk.
  *
  *
  * This file is part of ConfClerk.
  *
@@ -50,6 +50,8 @@ ConferenceEditor::ConferenceEditor(ConferenceModel* model, QWidget* parent)
     connect(changeUrl, SIGNAL(clicked()), SLOT(changeUrlClicked()));
     connect(refreshBtn, SIGNAL(clicked()), SLOT(refreshClicked()));
     connect(buttonBox, SIGNAL(rejected()), SLOT(close()));
     connect(changeUrl, SIGNAL(clicked()), SLOT(changeUrlClicked()));
     connect(refreshBtn, SIGNAL(clicked()), SLOT(refreshClicked()));
     connect(buttonBox, SIGNAL(rejected()), SLOT(close()));
+    connect(conferenceDtsHours, SIGNAL(valueChanged(int)), SLOT(dtsChanged()));
+    connect(conferenceDtsMinutes, SIGNAL(valueChanged(int)), SLOT(dtsChanged()));
 
     // it's OK to emit selection signals here
     // because they are not yet connected to anybody
 
     // it's OK to emit selection signals here
     // because they are not yet connected to anybody
@@ -89,11 +91,22 @@ void ConferenceEditor::itemSelected(const QModelIndex& current, const QModelInde
 
         conferenceTitle->setText(conf.title());
         conferenceSubtitle->setText(conf.subtitle());
 
         conferenceTitle->setText(conf.title());
         conferenceSubtitle->setText(conf.subtitle());
-        conferenceWhere->setText(conf.city() + (!conf.venue().isEmpty() ? ", " + conf.venue() : ""));
+        QString where = conf.city();
+        if (!conf.city().isEmpty() && !conf.venue().isEmpty()) where += ", ";
+        where += conf.venue();
+        conferenceWhere->setText(where);
         conferenceWhen->setText(
                 conf.start().toString("yyyy-MM-dd")
                 + " - " +
                 conf.end().toString("yyyy-MM-dd"));
         conferenceWhen->setText(
                 conf.start().toString("yyyy-MM-dd")
                 + " - " +
                 conf.end().toString("yyyy-MM-dd"));
+        if (conf.hasUtcOffset()) {
+            conferenceUtcOffset->setText(QString::number(conf.utcOffset()) + " min");
+        } else {
+            conferenceUtcOffset->setText("N/A");
+        }
+        int dts = conf.displayTimeShift();
+        conferenceDtsHours->setValue(dts / 60);
+        conferenceDtsMinutes->setValue(abs(dts) % 60);
         conferenceInfo->setCurrentIndex(0);
         removeBtn->show();
     }
         conferenceInfo->setCurrentIndex(0);
         removeBtn->show();
     }
@@ -160,6 +173,14 @@ void ConferenceEditor::refreshClicked()
     emit haveConferenceUrl(url, selected_id);
 }
 
     emit haveConferenceUrl(url, selected_id);
 }
 
+void ConferenceEditor::dtsChanged() {
+    if (selected_id < 0) return;
+    Conference& conference = model->conferenceFromIndex(model->indexFromId(selected_id));
+    int minutes = conferenceDtsMinutes->value();
+    if (conferenceDtsHours->value() < 0) minutes *= -1;
+    conference.setDisplayTimeShift(conferenceDtsHours->value() * 60 + minutes);
+}
+
 void ConferenceEditor::importStarted()
 {
     addBtn->hide();
 void ConferenceEditor::importStarted()
 {
     addBtn->hide();