Changeset 2922 for vidalia/trunk/src
- Timestamp:
- 08/02/08 21:19:40 (4 months ago)
- Location:
- vidalia/trunk/src/vidalia/log
- Files:
-
- 6 modified
-
logheaderview.cpp (modified) (1 diff)
-
logheaderview.h (modified) (1 diff)
-
logtreewidget.cpp (modified) (3 diffs)
-
logtreewidget.h (modified) (2 diffs)
-
messagelog.cpp (modified) (1 diff)
-
messagelog.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
vidalia/trunk/src/vidalia/log/logheaderview.cpp
r2362 r2922 45 45 46 46 47 /** Resizes the column headers based on the longest message item. */48 void49 LogHeaderView::resize(int hint)50 {51 int size = sectionSize(COL_MESG);52 if (hint > size) {53 /* The message is wider than the window, so expand the column */54 setStretchLastSection(false);55 resizeSection(COL_MESG, hint);56 } else if (hint < size) {57 /* The message is short, so just stretch the last column to the end */58 setStretchLastSection(true);59 }60 }61 -
vidalia/trunk/src/vidalia/log/logheaderview.h
r2362 r2922 31 31 /** Resets all column widths back to their defaults. */ 32 32 void resetColumnWidths(); 33 /** Resizes the column headers based on the longest message item. */34 void resize(int hint);35 33 }; 36 34 -
vidalia/trunk/src/vidalia/log/logtreewidget.cpp
r2921 r2922 81 81 /* Set the default column widths the first time this is shown */ 82 82 ((LogHeaderView *)header())->resetColumnWidths(); 83 /* Adjust the message column properly */84 adjustMessageColumn();85 83 shown = true; 86 84 } … … 94 92 /* Clear the messages */ 95 93 clear(); 96 }97 98 /** Adjusts the message column width to accomodate long messages. */99 void100 LogTreeWidget::adjustMessageColumn()101 {102 /* Adjust the message column, based on the longest item. */103 ((LogHeaderView *)header())->resize(sizeHintForColumn(MessageColumn));104 }105 106 /** Adds a message log item. */107 void108 LogTreeWidget::addMessageItem(LogTreeItem *item)109 {110 /* Add the new item. */111 addTopLevelItem(item);112 /* Adjust the column headers to accomodate a long message, if necesssary */113 adjustMessageColumn();114 94 } 115 95 … … 192 172 * message is not sorted until the message log has focus again. 193 173 */ 194 setSortingEnabled(false); 195 add MessageItem(item);174 setSortingEnabled(false); 175 addTopLevelItem(item); 196 176 setSortingEnabled(true); 197 177 -
vidalia/trunk/src/vidalia/log/logtreewidget.h
r2921 r2922 64 64 QList<LogTreeItem *> find(QString text, bool highlight = true); 65 65 66 /** Adjusts the message column, for long messages. */67 void adjustMessageColumn();68 69 66 public slots: 70 67 /** Clears all contents on the message log and resets the counter. */ … … 80 77 81 78 private: 82 /** Adds a message log item. */83 void addMessageItem(LogTreeItem *item);84 79 /** Casts a QList of one pointer type to another. */ 85 80 QList<LogTreeItem *> qlist_cast(QList<QTreeWidgetItem *> inlist); -
vidalia/trunk/src/vidalia/log/messagelog.cpp
r2533 r2922 81 81 { 82 82 _logFile.close(); 83 }84 85 /** Responds to the user resizing the message log. */86 void87 MessageLog::resizeEvent(QResizeEvent *event)88 {89 Q_UNUSED(event);90 91 /* Let the message list know that it may need to add a scrollbar */92 ui.lstMessages->adjustMessageColumn();93 83 } 94 84 -
vidalia/trunk/src/vidalia/log/messagelog.h
r2362 r2922 64 64 void help(); 65 65 66 protected:67 /** Responds to the user resizing the message log. */68 void resizeEvent(QResizeEvent *event);69 70 66 private: 71 67 /** Create and bind actions to events **/
