From 838930862de2addd9b47ab57b2aa170930ff5f3d Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Fri, 7 Dec 2012 21:19:23 +0100 Subject: [PATCH] [gui] s/Line_Edit/Drag_Drop_Line_Edit/. --- frontend/Makefile.am | 16 +++++++++------- frontend/{lineedit.cpp => ddlineedit.cpp} | 15 ++++++++------- frontend/{lineedit.h => ddlineedit.h} | 14 +++++++------- frontend/maingui.cpp | 4 ++-- frontend/maingui.h | 8 ++++---- 5 files changed, 30 insertions(+), 27 deletions(-) rename frontend/{lineedit.cpp => ddlineedit.cpp} (82%) rename frontend/{lineedit.h => ddlineedit.h} (76%) diff --git a/frontend/Makefile.am b/frontend/Makefile.am index f5aedbe..7c46769 100644 --- a/frontend/Makefile.am +++ b/frontend/Makefile.am @@ -40,15 +40,16 @@ manpages = ttfautohint.1 if USE_QT bin_PROGRAMS += ttfautohintGUI - ttfautohintGUI_SOURCES = info.cpp \ + ttfautohintGUI_SOURCES = ddlineedit.cpp \ + ddlineedit.h \ + info.cpp \ info.h \ - lineedit.cpp \ - lineedit.h \ main.cpp \ maingui.cpp \ maingui.h - nodist_ttfautohintGUI_SOURCES = maingui.moc.cpp \ - lineedit.moc.cpp + nodist_ttfautohintGUI_SOURCES = ddlineedit.moc.cpp \ + maingui.moc.cpp + ttfautohintGUI_CXXFLAGS = $(QT_CXXFLAGS) ttfautohintGUI_LDFLAGS = $(QT_LDFLAGS) ttfautohintGUI_CPPFLAGS = $(AM_CPPFLAGS) \ @@ -57,8 +58,9 @@ if USE_QT ttfautohintGUI_LDADD = $(LDADD) \ $(QT_LIBS) - BUILT_SOURCES = maingui.moc.cpp \ - lineedit.moc.cpp + BUILT_SOURCES = ddlineedit.moc.cpp \ + maingui.moc.cpp + manpages += ttfautohintGUI.1 endif diff --git a/frontend/lineedit.cpp b/frontend/ddlineedit.cpp similarity index 82% rename from frontend/lineedit.cpp rename to frontend/ddlineedit.cpp index 019976a..6fb4eb0 100644 --- a/frontend/lineedit.cpp +++ b/frontend/ddlineedit.cpp @@ -1,4 +1,4 @@ -// lineedit.cpp +// ddlineedit.cpp // Copyright (C) 2012 by Werner Lemberg. // @@ -11,13 +11,14 @@ // with the ttfautohint library. -// Derived class `Line_Edit' is QLineEdit which accepts drag and drop. +// Derived class `Drag_Drop_Line_Edit' is QLineEdit +// which accepts drag and drop. #include -#include "lineedit.h" +#include "ddlineedit.h" -Line_Edit::Line_Edit(QWidget* parent) +Drag_Drop_Line_Edit::Drag_Drop_Line_Edit(QWidget* parent) : QLineEdit(parent) { // empty @@ -28,7 +29,7 @@ Line_Edit::Line_Edit(QWidget* parent) // which work everywhere. So we rely on the extension. void -Line_Edit::dragEnterEvent(QDragEnterEvent* event) +Drag_Drop_Line_Edit::dragEnterEvent(QDragEnterEvent* event) { QList url_list; QString file_name; @@ -53,7 +54,7 @@ Line_Edit::dragEnterEvent(QDragEnterEvent* event) void -Line_Edit::dropEvent(QDropEvent* event) +Drag_Drop_Line_Edit::dropEvent(QDropEvent* event) { QList url_list; QString file_name; @@ -78,4 +79,4 @@ Line_Edit::dropEvent(QDropEvent* event) event->acceptProposedAction(); } -// end of lineedit.cpp +// end of ddlineedit.cpp diff --git a/frontend/lineedit.h b/frontend/ddlineedit.h similarity index 76% rename from frontend/lineedit.h rename to frontend/ddlineedit.h index f131e8d..4f8c9b7 100644 --- a/frontend/lineedit.h +++ b/frontend/ddlineedit.h @@ -1,4 +1,4 @@ -// lineedit.h +// ddlineedit.h // Copyright (C) 2012 by Werner Lemberg. // @@ -11,26 +11,26 @@ // with the ttfautohint library. -#ifndef __LINEEDIT_H__ -#define __LINEEDIT_H__ +#ifndef __DDLINEEDIT_H__ +#define __DDLINEEDIT_H__ #include #include -class Line_Edit +class Drag_Drop_Line_Edit : public QLineEdit { Q_OBJECT public: - Line_Edit(QWidget* = 0); + Drag_Drop_Line_Edit(QWidget* = 0); void dragEnterEvent(QDragEnterEvent*); void dropEvent(QDropEvent*); }; -#endif // __LINEEDIT_H__ +#endif // __DDLINEEDIT_H__ -// end of lineedit.h +// end of ddlineedit.h diff --git a/frontend/maingui.cpp b/frontend/maingui.cpp index 7ddf68f..1f4e29a 100644 --- a/frontend/maingui.cpp +++ b/frontend/maingui.cpp @@ -775,7 +775,7 @@ Main_GUI::create_layout() completer->setModel(model); QLabel* input_label = new QLabel(tr("&Input File:")); - input_line = new Line_Edit; + input_line = new Drag_Drop_Line_Edit; input_button = new QPushButton(tr("Browse...")); input_label->setBuddy(input_line); // enforce rich text to get nice word wrapping @@ -785,7 +785,7 @@ Main_GUI::create_layout() input_line->setCompleter(completer); QLabel* output_label = new QLabel(tr("&Output File:")); - output_line = new Line_Edit; + output_line = new Drag_Drop_Line_Edit; output_button = new QPushButton(tr("Browse...")); output_label->setBuddy(output_line); output_label->setToolTip( diff --git a/frontend/maingui.h b/frontend/maingui.h index 57cf05e..2a133e7 100644 --- a/frontend/maingui.h +++ b/frontend/maingui.h @@ -17,7 +17,7 @@ #include #include -#include "lineedit.h" +#include "ddlineedit.h" #include #include @@ -35,7 +35,7 @@ class QMenu; class QPushButton; class QSpinBox; -class Line_Edit; +class Drag_Drop_Line_Edit; class Main_GUI : public QMainWindow @@ -104,10 +104,10 @@ private: QMenu* file_menu; QMenu* help_menu; - Line_Edit* input_line; + Drag_Drop_Line_Edit* input_line; QPushButton* input_button; - Line_Edit* output_line; + Drag_Drop_Line_Edit* output_line; QPushButton* output_button; QSpinBox* min_box; -- 2.11.4.GIT