summaryrefslogtreecommitdiffstats
path: root/src/progs/pickit2/gui/pickit2_group_ui.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 18:42:24 +0000
commitf508189682b6fba62e08feeb1596f682bad5fff9 (patch)
tree28aeb0e6c19386c385c1ce5edf8a92c1bca15281 /src/progs/pickit2/gui/pickit2_group_ui.cpp
downloadpiklab-f508189682b6fba62e08feeb1596f682bad5fff9.tar.gz
piklab-f508189682b6fba62e08feeb1596f682bad5fff9.zip
Added KDE3 version of PikLab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/progs/pickit2/gui/pickit2_group_ui.cpp')
-rw-r--r--src/progs/pickit2/gui/pickit2_group_ui.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/progs/pickit2/gui/pickit2_group_ui.cpp b/src/progs/pickit2/gui/pickit2_group_ui.cpp
new file mode 100644
index 0000000..f36395a
--- /dev/null
+++ b/src/progs/pickit2/gui/pickit2_group_ui.cpp
@@ -0,0 +1,52 @@
+/***************************************************************************
+ * Copyright (C) 2006 Nicolas Hadacek <[email protected]> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+#include "pickit2_group_ui.h"
+
+#include <kfiledialog.h>
+
+#include "common/global/purl.h"
+#include "common/gui/misc_gui.h"
+#include "progs/gui/prog_config_widget.h"
+#include "progs/base/prog_group.h"
+#include "progs/pickit2/base/pickit2_prog.h"
+#include "progs/pickit2/base/pickit2.h"
+
+//----------------------------------------------------------------------------
+Pickit::AdvancedDialog::AdvancedDialog(Base &base, QWidget *parent, const char *name)
+ : ::Programmer::PicAdvancedDialog(base, parent, name)
+{}
+
+void Pickit::AdvancedDialog::regenerateCalibration()
+{
+ if ( !base().deviceHasOsccalRegeneration() ) {
+ MessageBox::sorry(i18n("Osccal regeneration not available for the selected device."), Log::Show);
+ return;
+ }
+ KFileDialog dialog(":open_autohex", PURL::filter(PURL::Hex), this, "autohex_dialog", true);
+ dialog.setOperationMode(KFileDialog::Opening);
+ dialog.setCaption(i18n("Open Calibration Firmware"));
+ dialog.setMode(KFile::File);
+ //dialog.ops->clearHistory();
+ dialog.setSelection("autocal.hex");
+ dialog.exec();
+ PURL::Url url(dialog.selectedURL());
+ if ( url.isEmpty() ) return;
+ base().regenerateOsccal(url);
+}
+
+//----------------------------------------------------------------------------
+::Programmer::ConfigWidget *Pickit2::GroupUI::createConfigWidget(QWidget *parent) const
+{
+ return new ::Programmer::ConfigWidget(static_cast<const ::Programmer::Group &>(group()), parent);
+}
+
+::Programmer::AdvancedDialog *Pickit2::GroupUI::createAdvancedDialog(::Programmer::Base &base, QWidget *parent) const
+{
+ return new Pickit::AdvancedDialog(static_cast<Base &>(base), parent, "pickit2_advanced_dialog");
+}