~ubuntu-branches/ubuntu/vivid/qtm/vivid-proposed

« back to all changes in this revision

Viewing changes to EditingWindow.h

  • Committer: Package Import Robot
  • Author(s): Patryk Cisek
  • Date: 2014-10-01 13:00:44 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: package-import@ubuntu.com-20141001130044-77e61lnh1ezcl8nb
Tags: 1.3.17-1
* New upstream release
* Bumped Standards-Version to 3.9.5
* Using dpkd-buildflags from now on

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#ifndef CATKIN_H
24
24
#define CATKIN_H
25
25
 
26
 
#include "ui_EditingWindowBase.h"
 
26
// #include "ui_EditingWindowBase.h"
27
27
#include "ui_SideWidget.h"
28
28
#include "ui_aboutbox.h"
29
29
//#include "ui_account_form.h"
41
41
#endif
42
42
#include "Application.h"
43
43
 
 
44
#include <QMainWindow>
44
45
#include <QHash>
45
46
#include <QColor>
46
47
#include <QtXml>
 
48
#include <QString>
47
49
 
48
50
#ifndef DONT_USE_SSL
49
51
#include <QSslError>
67
69
class QHostInfo;
68
70
class QSystemTrayIcon;
69
71
class QMenu;
 
72
class QToolBar;
70
73
 
71
74
class QNetworkAccessManager;
72
75
class QNetworkReply;
86
89
#define PROPERSEPS( x ) x
87
90
#endif
88
91
 
 
92
class SuperMenu;
 
93
 
89
94
class EditingWindow : public QMainWindow
90
95
{
91
96
  Q_OBJECT
101
106
#endif
102
107
  static bool caseInsensitiveLessThan( const QString &, const QString & );
103
108
  bool handleArguments();
 
109
  TEXTEDIT *console;
104
110
  QString postTitle();
 
111
  static void positionWidget( QWidget *, QWidget * );
105
112
 
106
113
  typedef enum _hbiz {
107
114
    None,
108
115
    _blogger_getUsersBlogs,
109
116
    _metaWeblog_newPost, _metaWeblog_editPost, _metaWeblog_newMediaObject,
110
117
    _mt_publishPost, _mt_getCategoryList, _mt_setPostCategories,
111
 
    _wp_getTags, _wp_newCategory
 
118
    _wp_getTags, _wp_getPosts_ID_ONLY, _wp_newCategory, 
 
119
    _wp_newPost, _wp_editPost
112
120
  } HttpBusinessType;
113
121
 
114
122
 private:
115
 
  Ui::MainWindow ui;
116
123
  Ui::CategoryWidget cw;
117
124
  void doUiSetup();
118
125
  void checkForEmptySettings();
119
126
  void setEditorColors();
120
127
  void setTextFonts();
121
128
  void setInitialAccount();
122
 
  void positionWidget( QWidget *, QWidget * );
123
129
  void readSettings();
124
130
  void readServerSettings();
125
131
  //void copyOldSettingsToNewDefaultElement();
134
140
  void mt_getCategoryList( QByteArray );
135
141
  void mt_setPostCategories( QByteArray );
136
142
  void wp_getTags( QByteArray );
 
143
  void wp_getPosts_ID_Only( QByteArray );
137
144
  void wp_newCategory( QByteArray );
 
145
  void wp_newPost( QByteArray );
 
146
  void wp_editPost( QByteArray );
138
147
  void submitMTEdit();
 
148
  void submitWPEdit();
139
149
  bool saveCheck();
140
150
  bool saveCheck( bool );
141
151
  QDomElement XmlValue( QDomDocument &, QString, QString,
143
153
  QDomElement XmlMember( QDomDocument &, QString, QString, QString );
144
154
  QDomElement XmlMethodName( QDomDocument &, QString );
145
155
  QDomElement XmlRpcArray( QDomDocument &, QString, QList<QString> );
 
156
  QDomElement XmlRpcArray( QDomDocument &, QString, QString, QList<QString> );
146
157
  void setNetworkActionsEnabled( bool );
147
158
  QString & getHTMLList( QString, QString & );
148
159
  void saveAutoLinkDictionary();
150
161
  QByteArray toBase64( QByteArray & );
151
162
  void addToConsole( const QString & );
152
163
  void handleEnableCategories();
153
 
  void updateRecentFileList( const QString &, const QString & );
154
 
  void updateRecentFileMenu();
155
164
  void extractAccountAttributes();
156
165
  QString decodeXmlEntities( QString );
157
166
  void placeNetworkRequest( HttpBusinessType, QByteArray & );
158
 
  void setHost( QHttp *, QString &, QString &, bool );
 
167
  // void setHost( QHttp *, QString &, QString &, bool );
159
168
  void setEditActionsEnabled( bool );
160
169
  void purgeBlankAccounts();
 
170
  QAction * new_action( QString, // title
 
171
                        QString, // tooltip
 
172
                        QString,  // What's this help
 
173
                        QObject *receiver = 0, // receiver
 
174
                        const char *slot = 0 // slot
 
175
                      );
161
176
 
162
177
  int currentAccount, currentBlog, loadedEntryBlog;
163
178
  QString loadedAccountId;
189
204
  QHash<QString, QString> autoLinkTitleDictionary;
190
205
  QHash<QString, int> autoLinkTargetDictionary;
191
206
  QByteArray responseData;
192
 
  QString entryNumber, dateTime;
 
207
  QString entryNumber, dateTime, entryHash;
193
208
  QString filename;
194
209
  int primaryCat;
195
210
  QString otherCatsList;
227
242
  SysTrayIcon *sti;
228
243
#endif
229
244
  QHash <QString, QChar> xmlEntities;
 
245
  SuperMenu *superMenu;
 
246
  QToolBar *toolBar;
 
247
  QAction *action_Open, *action_Save, 
 
248
          *action_Bold, *action_Italic, *action_Underline,
 
249
          *action_Blockquote, *action_Link, *action_Image, *action_More,
 
250
          *action_Preview, *action_Blog_this;
 
251
  QAction *addWPTagAction, *removeWPTagAction, *refreshWPTagsAction,
 
252
          *addTechTagAction, *addClipTechTagAction, *removeTechTagAction,
 
253
          *addTBPingAction, *addClipPingAction, *removeTBPingAction;
230
254
 
231
255
 private slots:
232
 
  void about();
233
256
  void choose( const QString fname = QString() );
234
257
  void openRecentFile();
235
258
  void save( const QString &, bool exp = false );
247
270
  void changeAccount( int );
248
271
  void extractAccountDetails();
249
272
  void changeBlog( int, bool fromChangeAccount = false );
250
 
  void handleConsole( bool );
251
273
  void makeBold();
252
274
  void makeItalic();
253
275
  void makeUnderline();
274
296
  void redo();
275
297
  void makeUnorderedList();
276
298
  void makeOrderedList();
277
 
  void doPreview( bool, bool markdownFailed = false );
278
299
  void showHighlightedURL( const QString & );
 
300
  void blogThis();
279
301
  void newMTPost(); // formerly blogThis()
 
302
  void newWPPost();
 
303
  void fetchEntryNumber();
280
304
  void updatePostCategories();
281
305
  void setPostCategories();
282
306
  void publishPost();
320
344
  void hideProgressBar();
321
345
  void reenableDirty();
322
346
  void saveAccountsDom();
 
347
  void showPassword( bool );
 
348
  void handleScheduleOnOff( int );
323
349
 
324
350
 public slots:
325
351
  void refreshCategories();
338
364
  void dirtifyIfText();
339
365
  void setDirtySignals( bool );
340
366
  void doInitialChangeBlog();
341
 
  void newDoc();
342
367
  void doQuit();
343
368
  void setPublishStatus( int );
344
369
  void setPostTitle( const QString & );
345
370
  void setPostClean();
346
371
  void showStatusBarMessage( const QString & );
347
 
  void setRecentFiles( const QList<Application::recentFile> & );
 
372
  void findAgain();
 
373
  void doPreview( bool, bool markdownFailed = false );
 
374
  void handleConsole( bool );
 
375
  void clearConsole();
 
376
  void setToolBarVisible( bool );
348
377
 
349
378
 protected:
350
379
  QStackedWidget *mainStack;
357
386
  QAction *blogThisIntlAction;
358
387
  QNetworkAccessManager *netmgr;
359
388
  QNetworkReply *currentReply;
360
 
  TEXTEDIT *console;
361
389
  TEXTEDIT *ed;
362
390
  QVBoxLayout *mainWindowLayoutWithSearch;
363
391
  QHBoxLayout *mainWindowLayout;
380
408
  virtual void showEvent( QShowEvent * );
381
409
  virtual void resizeEvent( QResizeEvent * );
382
410
  bool eventFilter( QObject *, QEvent * );
 
411
  virtual bool event( QEvent * );
383
412
 
384
413
signals:
385
414
  void httpBusinessFinished();