[med-svn] [aghermann] 79/85: WIP on sf/d/rk1968
andrei zavada
hmmr-guest at alioth.debian.org
Thu Sep 26 23:46:36 UTC 2013
This is an automated email from the git hooks/post-receive script.
hmmr-guest pushed a commit to branch master
in repository aghermann.
commit 8941b6b78f36460e60f534f09de769abd1ff2c29
Author: Andrei Zavada <johnhommer at gmail.com>
Date: Thu Sep 26 02:45:31 2013 +0300
WIP on sf/d/rk1968
---
upstream/data/sf-rk1968.glade | 72 +++++++--------------------
upstream/src/aghermann/ui/sf/d/rk1968.cc | 9 ++--
upstream/src/aghermann/ui/sf/d/rk1968.hh | 16 +++---
upstream/src/aghermann/ui/sf/d/rk1968_cb.cc | 31 ++++++++++--
4 files changed, 58 insertions(+), 70 deletions(-)
diff --git a/upstream/data/sf-rk1968.glade b/upstream/data/sf-rk1968.glade
index 8cdcb1c..efb42f6 100644
--- a/upstream/data/sf-rk1968.glade
+++ b/upstream/data/sf-rk1968.glade
@@ -48,57 +48,25 @@
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkToggleButton" id="bSFRKPreview">
+ <property name="label" translatable="yes">Preview</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
- <object class="GtkBox" id="box12">
+ <object class="GtkButton" id="bSFRKApply">
+ <property name="label">gtk-apply</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkButton" id="bSFRKTry">
- <property name="label" translatable="yes">Try</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="lSFRKWorking">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="valign">center</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Working …</property>
- <attributes>
- <attribute name="style" value="italic"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="bSFRKModify">
- <property name="label" translatable="yes">Modify</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
@@ -259,12 +227,6 @@
<placeholder/>
</child>
<child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
<object class="GtkSpinButton" id="eSFRKNremThetaDeltaRatio">
<property name="visible">True</property>
<property name="can_focus">True</property>
@@ -328,6 +290,8 @@
</child>
<action-widgets>
<action-widget response="-1">bSFRKDismiss</action-widget>
+ <action-widget response="-1">bSFRKPreview</action-widget>
+ <action-widget response="-5">bSFRKApply</action-widget>
</action-widgets>
</object>
<object class="GtkDialog" id="wSFRKProfileSave">
diff --git a/upstream/src/aghermann/ui/sf/d/rk1968.cc b/upstream/src/aghermann/ui/sf/d/rk1968.cc
index 93f4f16..b1fa1b9 100644
--- a/upstream/src/aghermann/ui/sf/d/rk1968.cc
+++ b/upstream/src/aghermann/ui/sf/d/rk1968.cc
@@ -47,9 +47,8 @@ SRK1968Dialog (SScoringFacility& p_)
AGH_GBGETOBJ (bSFRKProfileDiscard);
AGH_GBGETOBJ (eSFRKProfileList);
AGH_GBGETOBJ (eSFRKNremThetaDeltaRatio);
- AGH_GBGETOBJ (bSFRKTry);
- AGH_GBGETOBJ (bSFRKModify);
- AGH_GBGETOBJ (lSFRKWorking);
+ AGH_GBGETOBJ (bSFRKPreview);
+ AGH_GBGETOBJ (bSFRKApply);
AGH_GBGETOBJ (wSFRKProfileSave);
AGH_GBGETOBJ (eSFRKProfileSaveName);
AGH_GBGETOBJ (eSFRKProfileSaveOriginSubject);
@@ -78,8 +77,8 @@ SRK1968Dialog (SScoringFacility& p_)
(GCallback)eSFRK_any_profile_value_changed_cb,
this);
- G_CONNECT_1 (bSFRKTry, clicked);
- G_CONNECT_1 (bSFRKModify, clicked);
+ G_CONNECT_1 (bSFRKPreview, toggled);
+ G_CONNECT_1 (bSFRKApply, clicked);
G_CONNECT_1 (eSFRKProfileSaveName, changed);
diff --git a/upstream/src/aghermann/ui/sf/d/rk1968.hh b/upstream/src/aghermann/ui/sf/d/rk1968.hh
index e72d18e..f0e54c3 100644
--- a/upstream/src/aghermann/ui/sf/d/rk1968.hh
+++ b/upstream/src/aghermann/ui/sf/d/rk1968.hh
@@ -12,6 +12,7 @@
#ifndef AGH_AGHERMANN_UI_SF_D_RK1968_H_
#define AGH_AGHERMANN_UI_SF_D_RK1968_H_
+#include "libsigfile/page.hh"
#include "aghermann/rk1968/rk1968.hh"
#include "aghermann/ui/ui++.hh"
#include "aghermann/ui/dirlevel-storable-adapter.hh"
@@ -35,6 +36,9 @@ struct SScoringFacility::SRK1968Dialog
explicit SRK1968Dialog (SScoringFacility&);
~SRK1968Dialog ();
+ vector<sigfile::SPage>
+ backup;
+
// parent
SScoringFacility&
_p;
@@ -59,11 +63,10 @@ struct SScoringFacility::SRK1968Dialog
GtkSpinButton
*eSFRKNremThetaDeltaRatio;
+ GtkToggleButton
+ *bSFRKPreview;
GtkButton
- *bSFRKTry,
- *bSFRKModify;
- GtkLabel
- *lSFRKWorking;
+ *bSFRKApply;
GtkDialog
*wSFRKProfileSave;
@@ -75,7 +78,6 @@ struct SScoringFacility::SRK1968Dialog
*eSFRKProfileSaveOriginUser;
GtkButton
*bSFRKProfileSaveOK;
-
};
@@ -94,8 +96,8 @@ gboolean wSFRK_configure_event_cb( GtkWidget*, GdkEventConfigure*, gpointer);
void eSFRK_any_profile_value_changed_cb( GtkSpinButton*, gpointer);
-void bSFRKTry_clicked_cb( GtkButton*, gpointer);
-void bSFRKModify_clicked_cb( GtkButton*, gpointer);
+void bSFRKPreview_toggled_cb( GtkToggleButton*, gpointer);
+void bSFRKApply_clicked_cb( GtkButton*, gpointer);
void eSFRK_any_profile_origin_toggled_cb(GtkRadioButton*, gpointer);
void eSFRKProfileSaveName_changed_cb(GtkEditable*, gpointer);
diff --git a/upstream/src/aghermann/ui/sf/d/rk1968_cb.cc b/upstream/src/aghermann/ui/sf/d/rk1968_cb.cc
index d2ec435..5351724 100644
--- a/upstream/src/aghermann/ui/sf/d/rk1968_cb.cc
+++ b/upstream/src/aghermann/ui/sf/d/rk1968_cb.cc
@@ -68,17 +68,40 @@ eSFRK_any_profile_value_changed_cb(
void
-bSFRKTry_clicked_cb(
- GtkButton*,
+bSFRKPreview_toggled_cb(
+ GtkToggleButton* button,
gpointer userdata)
{
auto& RK = *(SScoringFacility::SRK1968Dialog*)userdata;
+ auto& SF = RK._p;
+
+ if ( gtk_toggle_button_get_active(button) ) {
+ SBusyBlock bb (RK.wSFRK);
+
+ RK.backup = SF.sepisode().sources.front().pages();
+
+ RK.W_V.down();
+ RK.Pp2.score( SF.sepisode());
+
+ gtk_widget_set_sensitive( (GtkWidget*)RK.bSFRKApply, TRUE);
+
+ } else {
+ SF.sepisode().sources.front().pages() = RK.backup;
+
+ gtk_widget_set_sensitive( (GtkWidget*)RK.bSFRKApply, FALSE);
+ }
+
+ // gtk_label_set_markup(
+ // AD.lSFADDirtyPercent,
+ // snprintf_buf( "%4.2f%% marked", AD.using_channel->calculate_dirty_percent() * 100));
+
+ gtk_widget_queue_draw( (GtkWidget*)SF.daSFMontage);
+ gtk_widget_queue_draw( (GtkWidget*)SF.daSFHypnogram);
-
}
void
-bSFRKModify_clicked_cb(
+bSFRKApply_clicked_cb(
GtkButton*,
gpointer userdata)
{
--
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/aghermann.git
More information about the debian-med-commit
mailing list