~ubuntu-branches/ubuntu/hardy/avidemux/hardy

« back to all changes in this revision

Viewing changes to avidemux/ADM_dialog/DIA_gototime.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2007-12-18 13:53:04 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071218135304-cdqec2lg2bglyz15
Tags: 1:2.4~preview3-0.0ubuntu1
* Upload to Ubuntu. (LP: #163287, LP: #126572)
* debian/changelog: re-added Ubuntu releases.
* debian/control:
  - Require debhelper >= 5.0.51 (for dh_icons) and imagemagick.
  - Build-depend on libsdl1.2-dev instead of libsdl-dev.
  - Build against newer libx264-dev. (LP: #138854)
  - Removed libamrnb-dev, not in Ubuntu yet.
* debian/rules:
  - Install all icon sizes, using convert (upstream installs none).
  - Added missing calls to dh_installmenu, dh_installman, dh_icons and
    dh_desktop.
* debian/menu, debian/avidemux-qt.menu:
  - Corrected package and executable names.
* debian/avidemux-common.install: Install icons.
* debian/avidemux.common.manpages: Install man/avidemux.1.
* debian/links, debian/avidemux-cli.links, debian/avidemux-gtk.links:
  - Link manpages to avidemux.1.gz.
* debian/install, debian/avidemux-qt.install, debian/avidemux-gtk.desktop,
  debian/avidemux-qt.desktop: Install desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
 
3
 
# include <config.h>
4
 
#include <sys/types.h>
5
 
#include <sys/stat.h>
6
 
 
7
 
#include <gdk/gdkkeysyms.h>
8
 
#include <gtk/gtk.h>
9
 
 
10
 
 
11
 
#include <gdk/gdkkeysyms.h>
12
 
#include <gtk/gtk.h>
13
 
#include "config.h"
14
 
 
15
 
#include "ADM_library/default.h"
16
 
#include "ADM_gui2/support.h"
17
 
#include "ADM_toolkit/toolkit_gtk.h"
18
 
#include "ADM_toolkit/toolkit_gtk_include.h"
19
 
 
20
 
static GtkWidget        *create_dialog1 (void);
21
 
 
22
 
 
23
 
#define SPIN_GET(x,y) {*y= gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(WID(x))) ;\
24
 
                                printf(#x":%d\n",*y);}
25
 
 
26
 
#define SPIN_SET(x,y)  {gtk_spin_button_set_value(GTK_SPIN_BUTTON(WID(x)),(gfloat)*y) ; \
27
 
                                printf(#x":%d\n",*y);}
28
 
static GtkWidget *create_dialog1 (void);
29
 
uint8_t DIA_gotoTime(uint16_t *hh, uint16_t *mm, uint16_t *ss);
30
 
uint8_t DIA_gotoTime(uint16_t *hh, uint16_t *mm, uint16_t *ss)
31
 
{
32
 
GtkWidget *dialog;
33
 
uint8_t ret;
34
 
        dialog=create_dialog1();
35
 
        gtk_register_dialog(dialog);
36
 
        ret=0;
37
 
 
38
 
        SPIN_SET(spinbuttonH,hh);
39
 
        SPIN_SET(spinbuttonM,mm);
40
 
        SPIN_SET(spinbuttonS,ss);
41
 
        if(gtk_dialog_run(GTK_DIALOG(dialog))==GTK_RESPONSE_OK)
42
 
        {
43
 
                SPIN_GET(spinbuttonH,hh);
44
 
                SPIN_GET(spinbuttonM,mm);
45
 
                SPIN_GET(spinbuttonS,ss);
46
 
                ret=1;
47
 
        }
48
 
        gtk_unregister_dialog(dialog);
49
 
        gtk_widget_destroy(dialog);
50
 
        return ret;
51
 
 
52
 
}
53
 
 
54
 
GtkWidget *create_dialog1 (void)
55
 
{
56
 
  GtkWidget *dialog1;
57
 
  GtkWidget *dialog_vbox1;
58
 
  GtkWidget *hbox1;
59
 
  GtkObject *spinbuttonH_adj;
60
 
  GtkWidget *spinbuttonH;
61
 
  GtkWidget *label1;
62
 
  GtkObject *spinbuttonM_adj;
63
 
  GtkWidget *spinbuttonM;
64
 
  GtkWidget *label2;
65
 
  GtkObject *spinbuttonS_adj;
66
 
  GtkWidget *spinbuttonS;
67
 
  GtkWidget *label3;
68
 
  GtkWidget *dialog_action_area1;
69
 
  GtkWidget *cancelbutton1;
70
 
  GtkWidget *okbutton1;
71
 
 
72
 
  dialog1 = gtk_dialog_new ();
73
 
  gtk_window_set_title (GTK_WINDOW (dialog1), _("Go to time"));
74
 
 
75
 
  dialog_vbox1 = GTK_DIALOG (dialog1)->vbox;
76
 
  gtk_widget_show (dialog_vbox1);
77
 
 
78
 
  hbox1 = gtk_hbox_new (FALSE, 0);
79
 
  gtk_widget_show (hbox1);
80
 
  gtk_box_pack_start (GTK_BOX (dialog_vbox1), hbox1, TRUE, TRUE, 0);
81
 
 
82
 
  spinbuttonH_adj = gtk_adjustment_new (0, 0, 10, 1, 10, 10);
83
 
  spinbuttonH = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonH_adj), 1, 0);
84
 
  gtk_widget_show (spinbuttonH);
85
 
  gtk_box_pack_start (GTK_BOX (hbox1), spinbuttonH, TRUE, TRUE, 0);
86
 
  gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbuttonH), TRUE);
87
 
 
88
 
  label1 = gtk_label_new (_("h"));
89
 
  gtk_widget_show (label1);
90
 
  gtk_box_pack_start (GTK_BOX (hbox1), label1, FALSE, FALSE, 0);
91
 
  gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
92
 
 
93
 
  spinbuttonM_adj = gtk_adjustment_new (0, 0, 59, 1, 10, 10);
94
 
  spinbuttonM = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonM_adj), 1, 0);
95
 
  gtk_widget_show (spinbuttonM);
96
 
  gtk_box_pack_start (GTK_BOX (hbox1), spinbuttonM, TRUE, TRUE, 0);
97
 
 
98
 
  label2 = gtk_label_new (_("mn"));
99
 
  gtk_widget_show (label2);
100
 
  gtk_box_pack_start (GTK_BOX (hbox1), label2, FALSE, FALSE, 0);
101
 
  gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_LEFT);
102
 
 
103
 
  spinbuttonS_adj = gtk_adjustment_new (0, 0, 59, 1, 10, 10);
104
 
  spinbuttonS = gtk_spin_button_new (GTK_ADJUSTMENT (spinbuttonS_adj), 1, 0);
105
 
  gtk_widget_show (spinbuttonS);
106
 
  gtk_box_pack_start (GTK_BOX (hbox1), spinbuttonS, TRUE, TRUE, 0);
107
 
 
108
 
  label3 = gtk_label_new (_("s"));
109
 
  gtk_widget_show (label3);
110
 
  gtk_box_pack_start (GTK_BOX (hbox1), label3, FALSE, FALSE, 0);
111
 
  gtk_label_set_justify (GTK_LABEL (label3), GTK_JUSTIFY_LEFT);
112
 
 
113
 
  dialog_action_area1 = GTK_DIALOG (dialog1)->action_area;
114
 
  gtk_widget_show (dialog_action_area1);
115
 
  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
116
 
 
117
 
  cancelbutton1 = gtk_button_new_from_stock ("gtk-cancel");
118
 
  gtk_widget_show (cancelbutton1);
119
 
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), cancelbutton1, GTK_RESPONSE_CANCEL);
120
 
  GTK_WIDGET_SET_FLAGS (cancelbutton1, GTK_CAN_DEFAULT);
121
 
 
122
 
  okbutton1 = gtk_button_new_from_stock ("gtk-ok");
123
 
  gtk_widget_show (okbutton1);
124
 
  gtk_dialog_add_action_widget (GTK_DIALOG (dialog1), okbutton1, GTK_RESPONSE_OK);
125
 
  GTK_WIDGET_SET_FLAGS (okbutton1, GTK_CAN_DEFAULT);
126
 
 
127
 
  /* Store pointers to all widgets, for use by lookup_widget(). */
128
 
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog1, "dialog1");
129
 
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_vbox1, "dialog_vbox1");
130
 
  GLADE_HOOKUP_OBJECT (dialog1, hbox1, "hbox1");
131
 
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonH, "spinbuttonH");
132
 
  GLADE_HOOKUP_OBJECT (dialog1, label1, "label1");
133
 
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonM, "spinbuttonM");
134
 
  GLADE_HOOKUP_OBJECT (dialog1, label2, "label2");
135
 
  GLADE_HOOKUP_OBJECT (dialog1, spinbuttonS, "spinbuttonS");
136
 
  GLADE_HOOKUP_OBJECT (dialog1, label3, "label3");
137
 
  GLADE_HOOKUP_OBJECT_NO_REF (dialog1, dialog_action_area1, "dialog_action_area1");
138
 
  GLADE_HOOKUP_OBJECT (dialog1, cancelbutton1, "cancelbutton1");
139
 
  GLADE_HOOKUP_OBJECT (dialog1, okbutton1, "okbutton1");
140
 
 
141
 
  gtk_widget_grab_default (okbutton1);
142
 
  return dialog1;
143
 
}
144