Move common time shifting code to ui/time_shift.[ch]. Change the
[metze/wireshark/wip.git] / ui / qt / time_shift_dialog.h
1 /* time_shift_dialog.h
2  *
3  * $Id$
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 #ifndef TIME_SHIFT_DIALOG_H
25 #define TIME_SHIFT_DIALOG_H
26
27 #include "config.h"
28
29 #include <glib.h>
30
31 #include "cfile.h"
32
33 #include "syntax_line_edit.h"
34
35 #include <QDialog>
36 #include <QPushButton>
37
38 namespace Ui {
39 class TimeShiftDialog;
40 }
41
42 class TimeShiftDialog : public QDialog
43 {
44     Q_OBJECT
45     
46 public:
47     explicit TimeShiftDialog(QWidget *parent = 0, capture_file *cf = NULL);
48     ~TimeShiftDialog();
49
50 public slots:
51     void setCaptureFile(capture_file *cf) { cap_file_ = cf; }
52
53 private:
54     Ui::TimeShiftDialog *ts_ui_;
55     capture_file *cap_file_;
56     QPushButton *apply_button_;
57     QString syntax_err_;
58
59     void enableWidgets();
60     void checkFrameNumber(SyntaxLineEdit &frame_le);
61     void checkDateTime(SyntaxLineEdit &time_le);
62
63 private slots:
64     void on_shiftAllButton_toggled(bool checked);
65     void on_setOneButton_toggled(bool checked);
66     void on_unshiftAllButton_toggled(bool checked);
67     void on_setTwoCheckBox_toggled(bool checked);
68     void on_shiftAllTimeLineEdit_textChanged(const QString &sa_text);
69     void on_setOneTimeLineEdit_textChanged(const QString &so_text);
70     void on_setOneFrameLineEdit_textChanged(const QString &frame_text);
71     void on_setTwoFrameLineEdit_textChanged(const QString &frame_text);
72     void on_setTwoTimeLineEdit_textChanged(const QString &st_text);
73     void applyTimeShift();
74     void on_buttonBox_helpRequested();
75 };
76
77 #endif // TIME_SHIFT_DIALOG_H